Home   Help Search Login Register  

Author Topic: Create Unit  (Read 856 times)

0 Members and 2 Guests are viewing this topic.

24Gamer

  • Guest
Create Unit
« on: 01 Jun 2004, 20:15:15 »
I wanted to put a General into my mission, and i was told that i could put one in with the editor upgrade but that kept disconnecting people. so now im trying to do it with a script, i have pretty good experience with scripting but for some reason i can't get it to work:

GEN = "GeneralE" createunit ["1600, 1400, 0", Null]
but this does't work, come up with generic error :-/
i've also tried
GEN = "GeneralE" createunit [getpos GENie, solbase]
"You need to have an east soldier on the map called 'solbase' (no quotes) for the above to work"
all i want to do i create a general with the name GEN, not sure how the group parameter works :-X

Offline rhysduk

  • Former Staff
  • ****
Re:Create Unit
« Reply #1 on: 01 Jun 2004, 21:24:25 »
According to the COMREF you dont need the GEN = part of the syntax.

Is this the correct class name for the general? if u dont know it put the general on the map, save it and open the mission.sqm file. Look and find the soldier (general) you placed, use this class name for the CreateUnit command.


"GeneralE" createunit ["1600, 1400, 0", Null] This wont work becaus you have the pos and group wrong. Null is not a group, becoz its null (i think) the position i dont think you can have x,y,z etc even though u have " around it.

So taing that GENERALE is a class name for a unit.. use this..

"GeneralE" CreateUnit [getpos player, player]

Want me to explain it?

getpos player is the position of the player and
player is the group that you want the unit to become attached to..

You have to attach the unit to a group i think... This part of the command can be changed to what u like.. just make sure you have a named group in the mission.. even if its just a single unit.. name it as a group for hte unit u spawn to become attached to.

(You can always delete the unit u named as a group after the GENERAL hsa spwaned if you want the General to be on his own)

Sry if i lost u in all that.

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Create Unit
« Reply #2 on: 01 Jun 2004, 21:36:22 »
Lots and lots of threads about the createunit command in the forums.  ;)
Not all is lost.

24Gamer

  • Guest
Re:Create Unit
« Reply #3 on: 02 Jun 2004, 02:22:51 »
o nevermind, i used createvehicle and it worked fairly easily

Offline rhysduk

  • Former Staff
  • ****
Re:Create Unit
« Reply #4 on: 02 Jun 2004, 12:35:01 »
 ???
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Create Unit
« Reply #5 on: 02 Jun 2004, 18:05:38 »
I think he meant "Hey rhysduk & Artak, thanks for your help guys."   At least I hope that's what he meant.
Plenty of reviewed ArmA missions for you to play

24Gamer

  • Guest
Re:Create Unit
« Reply #6 on: 02 Jun 2004, 23:31:13 »
lol, thanks anyway  8)