Home   Help Search Login Register  

Author Topic: Createunit problem  (Read 670 times)

0 Members and 2 Guests are viewing this topic.

timmylondon

  • Guest
Createunit problem
« on: 18 Jan 2003, 02:52:36 »
Hello,

I have problem creating unit using script.

I used the following script:
"SoldierECrew" createunit [getpos g1, east1, "s1a = this", 1, 'SERGEANT"]

But it didnt create the unit.

Please tell me if my script is wrong.

Thanks,
Timmy

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Createunit problem
« Reply #1 on: 18 Jan 2003, 06:53:14 »
"SoldierECrew" createunit [getpos g1, east1, "s1a = this", 1, 'SERGEANT"]

Does the group east1 actually exist?  If not, it won't work.

Also, you have a typo in the rank.  The first single quote should be a double quote.  E.g., "SERGEANT".
Ranger

timmylondon

  • Guest
Re:Createunit problem
« Reply #2 on: 18 Jan 2003, 07:08:48 »
thanks for reply.

east1 is a group, right?

How can I make the east1 exist? I thought I can make a new group.

And for the single quote that was my own mistake.

Thanks,
Timmy

CrashnBurn

  • Guest
Re:Createunit problem
« Reply #3 on: 18 Jan 2003, 08:23:49 »
Just plop a east soldier in the editor, and in his ini put east1 = group this; deletevehicle this. Now you have a group with that name, and the soldier wont be in the map when it loads cause you deleted him. Give the soldier waypoints if you want, and the created units with that groupname will use them. Think of the soldier as a template you use to create units from.

timmylondon

  • Guest
Re:Createunit problem
« Reply #4 on: 18 Jan 2003, 08:31:38 »
Hello,

Thanks for reply, I fixed the createunit problem but I have some more problem needed to solve.

My problem is: the fourth Shilka won't move because there are no crews inside.

I created 5 Game logics, g2a to g2d are the four Shilka location and g2e is the place where the crews are created.

I created a Shilka called 'shilka' which removed using deletevehicle.

Please check the following script and please tell me if i made any mistakes.

Note: g4a is the waypoint of the four Shilkas.

-----------------------------------------------------------------------------
; Create shilka
; 1st ZSU
shilka1 = "ZSU" createvehicle getpos g2a
~1
"SoldierECrew" createunit [getpos g2e, shilka, "s1a = this", 1, "SERGEANT"]
"SoldierECrew" createunit [getpos g2e, shilka, "s1b = this", 1, "CORPORAL"]
"SoldierECrew" createunit [getpos g2e, shilka, "s1c = this", 1, "PRIVATE"]
~1
s1b moveincommander shilka1
s1a moveingunner shilka1
s1c moveindriver shilka1


; 2nd ZSU
shilka2 = "ZSU" createvehicle getpos g2b
~1
"SoldierECrew" createunit [getpos g2e, shilka, "s2a = this", 1, "SERGEANT"]
"SoldierECrew" createunit [getpos g2e, shilka, "s2b = this", 1, "CORPORAL"]
"SoldierECrew" createunit [getpos g2e, shilka, "s2c = this", 1, "PRIVATE"]
~1
s2b moveincommander shilka2
s2a moveingunner shilka2
s2c moveindriver shilka2

; 3rd ZSU
shilka3 = "ZSU" createvehicle getpos g2c
"SoldierECrew" createunit [getpos g2e, shilka, "s3a = this", 1, "SERGEANT"]
"SoldierECrew" createunit [getpos g2e, shilka, "s3b = this", 1, "CORPORAL"]
"SoldierECrew" createunit [getpos g2e, shilka, "s3c = this", 1, "PRIVATE"]
~1
s3b moveincommander shilka3
s3a moveingunner shilka3
s3c moveindriver shilka3

; 4th ZSU
~1
shilka4 = "ZSU" createvehicle getpos g2d
"SoldierECrew" createunit [getpos g2e, shilka, "s4a = this", 1, "SERGEANT"]
"SoldierECrew" createunit [getpos g2e, shilka, "s4b = this", 1, "CORPORAL"]
"SoldierECrew" createunit [getpos g2e, shilka, "s4c = this", 1, "PRIVATE"]
~1
s4b moveincommander shilka4
s4a moveingunner shilka4
s4c moveindriver shilka4

; Create waypoints

shilka1 domove (getpos g4a)
shilka2 domove (getpos g4a)
shilka3 domove (getpos g4a)
shilka4 domove (getpos g4a)
---------------------------------------------------------------------------

Thanks for looking the post.

Thanks,
Timmy

timmylondon

  • Guest
Re:Createunit problem
« Reply #5 on: 18 Jan 2003, 08:51:05 »
I solved the problem even without knowing what had happened. I just replay the script and it works fine.

Thanks,
Timmy