Jump to content
Sign in to follow this  
sirglider

Fire command unavaible in intro??

Recommended Posts

Hi all,

I can't figure out why the fire command doesn't work in my intro. If I copy exacty all the units in the mission part and let it run, my tanks fire perfectly:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">mytank fire "Shell"

But now if I try exactly the same in my intro part, it doesn't work. crazy_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">mytank fire# "Shell"; unknown variableSomething like that.

Could someone help me? Thx!

Share this post


Link to post
Share on other sites

Are there any other (intensive) scripts running during that scene?

Quote[/b] ]

mytank fire# "Shell"; unknown variable

Something like that.

What is it exactly? AFAIK there no such error message like unknown variable...

reserved variable maybe?

Share this post


Link to post
Share on other sites

Ok, my error looks more like:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">m1097 fire# "SWI_155mmSPA"; fire unknown operator

(It's for the test mission of our outcoming Swiss M109 Kawest)

So an idea?

Share this post


Link to post
Share on other sites
Ok, my error looks more like:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">m1097 fire# "SWI_155mmSPA"; fire unknown operator

(It's for the test mission of our outcoming Swiss M109 Kawest)

So an idea?

is "SWI_155mmSPA" the name of the gun, or the shell?

if it is the shell, you need to change it to the gun.

Share this post


Link to post
Share on other sites

yes, taurus could be right

maybe this could help :

With this small, one line command placed the players or AI's Initialization field, you can get the names of both the weapon and the ammo it fires. (in a hint)

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

this addeventhandler ["fired",{hint format ["Name of shot is: %1,%2", (_this select 2),(_this select 4)]}]

Share this post


Link to post
Share on other sites

What a waiste of ammo Blanco rock.gif

A simple:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["%1\n%2",weapons unit,magazines unit]

would have done the same tounge_o.gif

No offense meant Blanco smile_o.gif

~S~ CD

Share this post


Link to post
Share on other sites
What a waiste of ammo Blanco  rock.gif

A simple:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["%1\n%2",weapons unit,magazines unit]

would have done the same  tounge_o.gif

No offense meant Blanco  smile_o.gif

~S~ CD

Will this return all weapons of the vehicles, or just the one fired?

take the abrams(or any other tanks for that matter) which has one main gun and a MG.

Share this post


Link to post
Share on other sites

tank1 fire "heat120"

that works

if you are using custom tank well then, lets look up dude like the cpp.

Share this post


Link to post
Share on other sites

Hi All!

Thanks for all your answers. I don't have that much time to play OFP those days. But I see all your answers and tried some of them.

So my tank has following weapons: SWI_155mmSPA, SWI_MG12_7 and SWI_SmokeL and the magazines have the same names. I've also checked that in the game with yours methods.

But my bug is further.

If I do a simple intro the command

Quote[/b] ]mytank fire "SWI_155mmSPA"
works. Also the one with array and the one with the action ["fire","SWI_155mmSPA"].

But in my intro, I don't have the command, cause it's a cutscene and the problem seems to be here. For exactly the same situation, but with a camera in my intro, the following error is returned:

Quote[/b] ]mytank |#|fire ["SWI_155mmSPA","SWI_155mmSPA"]: Error Opérateur inconnu fire
It's in french, but the error message should look the same in english.

It gives me the same result with the fire "SWI_155mmSPA" action. crazy_o.gif

So an other idea guys?

Thx for your help!

Share this post


Link to post
Share on other sites

sirglider - check out if you are using the reserved variable

fire somewhere else in another way than it's supposed to be, in your intro - this could be an

explanation for your problem then  wink_o.gif

~S~ CD

Share this post


Link to post
Share on other sites

That's it!

You've found the solution. It was a realy basic mistake from me. I put at the beginning of my script a "variable":<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fire = 0which means it disable the fire command. That's why ofp didn't want to fire anymore!

Thx for your help guys!

Good sight! wink_o.gif

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  

×