OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: TOViper on 21 Jun 2003, 13:44:09
-
Hi!
I need help with creating units and giving them identities please!
My script looks as follow:
"SoldierWB" CreateUnit [getMarkerPos "testmarker", Testgroup, "new_soldier = this", 1, "Lieutnant"]
Testgroup was created a time ago, and all works fine! Got the unit instantly on the map, all settings are OK and my soldier is working.
But: How can I assign the unit an identity?
Yeah, right, with the "SetIdentity" command, looking like this:
new_soldier SetIdentity "Tony_Curtis" ("Tony_Curtis" is an identity added in the description.ext)
After doing the above script line, assigning the identity doesnt work.
Naturally I tried giving the SetIdentity command in the INIT-Field of the Unit above..
So the code will look as follows:
"SoldierWB" CreateUnit [getMarkerPos "testmarker", Testgroup, "new_soldier = this; this SetIdentity "Tony_Curtis"", 1, "Lieutnant"]
You see the problem? the "" (double "" ) is the problem...
How can I solve this problem?
greez
TOViper
-
asmuch as i remember u cant use setidentity in scripts :-\
but u can do it in triger ;)
or in da createdunit init (but i dono if it wil work) - u can use double "" (works w/ all OFP vers
"SoldierWB" CreateUnit [getMarkerPos "testmarker", Testgroup, "new_soldier = this; new_soldier SetIdentity ""Tony_Curtis""", 1, "Lieutnant"]
or u can use{} works w/ 1.75 +
"SoldierWB" CreateUnit [getMarkerPos "testmarker", Testgroup, "new_soldier = this; new_soldier SetIdentity {Tony_Curtis}", 1, "Lieutnant"]
LCD OUT
-
Hi!
Thnx for the fast reply!
IÂ've tested both things you wrote, and both things didnÂ't work -> :-\
But:
You are right saying that it works in triggers! IÂ've tested it with triggers, and it works fine -> not a nice solution for my actual problem, but ITS A solution -> :D
Mannnnny thanks to you!
greez
TOViper
-
:cheers:
just push da solve boton down dere ;)
LCD OUT