Home   Help Search Login Register  

Author Topic: Createunit & Identities  (Read 924 times)

0 Members and 1 Guest are viewing this topic.

TOViper

  • Guest
Createunit & Identities
« 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

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Createunit & Identities
« Reply #1 on: 21 Jun 2003, 14:00:02 »
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

Code: [Select]
"SoldierWB" CreateUnit [getMarkerPos "testmarker", Testgroup, "new_soldier = this; new_soldier  SetIdentity ""Tony_Curtis""", 1, "Lieutnant"]  
or u can use{} works w/ 1.75 +

Code: [Select]
"SoldierWB" CreateUnit [getMarkerPos "testmarker", Testgroup, "new_soldier = this; new_soldier  SetIdentity {Tony_Curtis}", 1, "Lieutnant"]  
LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

TOViper

  • Guest
Re:Createunit & Identities
« Reply #2 on: 21 Jun 2003, 14:52:22 »
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

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Createunit & Identities
« Reply #3 on: 21 Jun 2003, 22:48:55 »
:cheers:

just push da solve boton down dere ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta