OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dalton on 11 Jun 2004, 03:11:58
-
how do i spawn a smoke grenade? preferably red?
-
Hey dalton, you can do the following... Not sure if it's what you want tho...
"smokeshellred" camcreate (getpos 'smoke')
where 'smoke' = gamelogic/unit or vehicle name where you want the smoke to be... (no quotes)
or
"smokeshellred" camcreate (getpos (object '12345'))
where '12345' = objectid of an object in the mission editor (no quotes)
Just put either of the above in a trigger/unit init string etc... You may neeed to check that 'smokeshellred' is correct, think it is...
-
it dont work...
it says "type object, expect nothing"
-
More information ! ........... what exactly did you type in?
-
You need to use the following code:
_smoke = "smokeshellred" camcreate (getpos gamelogic)
If your putting this into a script, then keep the underscore at the begining. If your putting this somewhere else (trigger, init field), take away the underscore.
This code has been tested, and it works.
-
If you get an error message, you should always quote the whole message. Plus of course the whole of the code that you used. ;) "It don't work" ::) is one of the commonest lines used in this forum, and is unquestionably the most unhelpful. :P
Also, you should always check the syntax of a command in the comref before using it. And you should always[/i] check it again before posting. If I may quote a Comment on camCreate in the online comref:
You can use camCreate to create objects. For example:
flare1 = "flare" camCreate getpos gameLogic_1
Which, combined with nEO iNC's almost excellent post above, solves your problem. Answers in the forum are almost always fundamentally correct, but it is fairly common for there to be a minor error of syntax. (It happens to me all the time. :'()
In this case of course you've been lucky because j-man has kindly spotted the problem.