Home   Help Search Login Register  

Author Topic: Spawn of troops in game !  (Read 621 times)

0 Members and 1 Guest are viewing this topic.

Offline Capt Ryan

  • Members
  • *
  • Heil Myself !
    • Capt Ryans World War II Adventures
Spawn of troops in game !
« on: 20 Aug 2003, 15:36:24 »
 Ive made this quit simple spawn script works nice but it haves one bad thing , when the sqs is activated the game frezze for a few sec when the prosessor creates the 11 man unit on the map at the marker and Officer of the group -

My question is - is there a way to make it more smooth so the game does not frezze when spawning ?

------------------------------------------------------------------------------------
Capt Ryans WWII Adventures German Wehermacht Unit spawn script
------------------------------------------------------------------------------------

"WH_Schutze6" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Corporal"];
"WH_LMGunner" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_LMAmmo" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_Radop2" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_Medic" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_SchutzeG1" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_Schutze6" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_Schutze6" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_Schutze6" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_SQDLDR3" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];
"WH_SQDLDR3" createunit [getmarkerpos "spawnspot", spawnspotgroup, "WH_Schutze6 = this",0.9,"Private"];

#exit

exit

------------------------------------------------------------------------------

I know its a simple script but it works  ;o) if there is a better way please tell me .

Ryan

Capt Ryans WWII Adventures -  http://www.ofpww2.dk

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Spawn of troops in game !
« Reply #1 on: 20 Aug 2003, 16:06:31 »
I doubt it.   This is one of the reasons that createUnit does not solve the lag problem - creating the units causes lag.

What I suggest is that you create them in the Editor on an outlying island and setPos them in at the appropriate moment.    Failing that, start the creation process early and have a second between the creation of each unit, that will spread it out.   May not actually help, but worth a try.

You appear to be giving them all the same name, which is unlikely to be doing you any favours.
Plenty of reviewed ArmA missions for you to play

Offline Ottie

  • Members
  • *
  • And you think this is personal
Re:Spawn of troops in game !
« Reply #2 on: 20 Aug 2003, 16:12:52 »
The problem is you try to create the units all at once try creating the units with a delay in between. The second is if the game doesn't have loaded the soldier types the types must be loaded and this can take some time, so tip, only spawn soldier types that you are already using in your mission.

If you applie these two rules you will see that the units will be spawned a lot smoother
If you can't beat them, buy them

Offline Capt Ryan

  • Members
  • *
  • Heil Myself !
    • Capt Ryans World War II Adventures
Re:Spawn of troops in game !
« Reply #3 on: 20 Aug 2003, 18:27:05 »

Thanx Guys   :o   -

Macguba what do you mean by :


You appear to be giving them all the same name, which is unlikely to be doing you any favours.


They have no names but the orginal ? - you mean adding names like a1 a2 etc

Ryan

Capt Ryans WWII Adventures -  http://www.ofpww2.dk

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Spawn of troops in game !
« Reply #4 on: 20 Aug 2003, 19:00:09 »
Every one has

WH_Schutze6 = this

in its init line.   I'm not an expert on createunit, but I suspect this will name the unit WH_Schutze6.    Maybe not, since it's not giving you an error.
Plenty of reviewed ArmA missions for you to play

Offline Ottie

  • Members
  • *
  • And you think this is personal
Re:Spawn of troops in game !
« Reply #5 on: 20 Aug 2003, 19:58:57 »
You ar right macguba all the units have the same name so this means that you can only control the last created unit with the name WH_schutze6
If you can't beat them, buy them

Offline Capt Ryan

  • Members
  • *
  • Heil Myself !
    • Capt Ryans World War II Adventures
Re:Spawn of troops in game !
« Reply #6 on: 20 Aug 2003, 20:22:56 »
 I get no errors  . Might be because they are non playable and not a part of players group . They are the enemy and they keep comming at you in waves after wave after wave  ,  pass the ammo and praise the Lord ;o) .

Ive soved the problem a bit by suspending action and make a blackout cutscene during spawn , and call it Battel update  .

Thanx again   -

Ryan

Capt Ryans WWII Adventures -  http://www.ofpww2.dk

Offline Capt Ryan

  • Members
  • *
  • Heil Myself !
    • Capt Ryans World War II Adventures
Re:Spawn of troops in game !
« Reply #7 on: 25 Aug 2003, 20:27:53 »

Macguba was right the name has to be changed in the script like this :

"WH_Schutze6" createunit [getmarkerpos "spawnspot", spawnspotgroup, "ger2 = this",0.9,"Corporal"];


So to make the script work perfect name the troopers 2 to 12 , as the no 1 is group leader on map at marker .

Thanx again for the hint  .

Ryan


Capt Ryans WWII Adventures -  http://www.ofpww2.dk