Jump to content
Sign in to follow this  
DavidCR125

Weird problem (bug?)

Recommended Posts

I have been having a problem with a script I am writing. It seems that whenever I use addWeapon after initialization the gun is useless.

An example mission:

Start a new mission and add a single player to it. Then add a trigger that is activated be radio Alpha and in its on activation field put <removeAllWeapons player; player addWeapon "M16"; player addMagazine "M16";> without the < and >.

For me when I run this mission and activate the trigger I get an M16 in my hands but the gun doesn't work. By that I mean the little thing up in the top left corner of the screen that shows ammo is not there, the weapon will not reload, I can't use the sights and the only action I can do with the weapon is put it on my back (no Drop M16). I'm sure I used to be able to do this but now I can't.

If I put those same commands in the init.sqs file it works fine.

I have flashpoint: goty version 1.91, but I have also tried beta 1.96.

Can anyone tell me if I am doing something wrong?

Share this post


Link to post
Share on other sites

I just tried that but it still does not work. I must have broken something. I can't even use the sights on the gun.

Share this post


Link to post
Share on other sites

Ah yeah, try swapping through your weapons by pressing

the spacebar, or look for the selectWeapon command

in the comref.

Problem in your case is: the weapon is not selected properly

by adding it after initialisation.

:edit - wait, here's the command:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit selectWeapon weapon

Operand types:

unit: Object

weapon: String

Compatibility:

Version 1.27 required.

Type of returned value:

Nothing

Description:

Select given weapon. For weapon values see CfgWeapons.

Example:

soldierOne selectWeapon "LAWLauncher"

~S~ CD

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×