Home   Help Search Login Register  

Author Topic: Game pause  (Read 677 times)

0 Members and 1 Guest are viewing this topic.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Game pause
« on: 05 Jul 2003, 18:44:55 »
whenever I use this script, there is a noticeable, and quite annoying pause while the units are created.  Is there anyway to fix this?
;create script by -CrashnBurn- dwaters59@msn.com
; modified by zombie
;-----------------------------------------------------------
#start

_units2 = units west2

#loop

?(("Alive _x" count _units2) == 1): goto "create"
goto "loop"

#create
"OfficerW" createunit [getpos g2, west2, "w11 = this"]
"SoldierWG" createunit [getpos g2, west2, "w12 = this"]
"SoldierWLAW" createunit [getpos g2, west2, "w13 = this"]
"SoldierWAA" createunit [getpos g2, west2, "w14 = this"]
"SoldierWMedic" createunit [getpos g2, west2, "w15 = this"]
"SoldierWMG" createunit [getpos g2, west2, "w16 = this"]
exit

I figure by using this, I can cut down on lag by creating units when needed, but the pause everytime this or a similar executes just won't work

_hammy_

  • Guest
Re:Game pause
« Reply #1 on: 05 Jul 2003, 20:11:07 »
is g2 a gamelogic? also, does it pause before it creates the dudes, or in the middle somewhere?

edit:
try this

Code: [Select]
#start

_units2 = units west2

#loop

?(("Alive _x" count _units2) == 1): goto "create"
~0.1
goto "loop"

#create
"OfficerW" createunit [getpos g2, west2, "w11 = this"]
"SoldierWG" createunit [getpos g2, west2, "w12 = this"]
"SoldierWLAW" createunit [getpos g2, west2, "w13 = this"]
"SoldierWAA" createunit [getpos g2, west2, "w14 = this"]
"SoldierWMedic" createunit [getpos g2, west2, "w15 = this"]
"SoldierWMG" createunit [getpos g2, west2, "w16 = this"]

exit

i put a ~0.1 inside the loop cause if u dont, it will slow down yur comp.
« Last Edit: 05 Jul 2003, 20:14:43 by HAMMY »

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Game pause
« Reply #2 on: 05 Jul 2003, 20:30:31 »
yes g2 is a gamelogic
 it pauses as soon as #create starts, before the units are seen
interestingly enough, I tried this with creating 2 west groups and no matter which one is exec'd first, only the 1st one causes the pause

_hammy_

  • Guest
Re:Game pause
« Reply #3 on: 05 Jul 2003, 20:33:47 »
hmmmm thats wierd, i dont see anything that would cause it to pause, unless i keep on skipping some code in the script that will cause it to pause

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Game pause
« Reply #4 on: 05 Jul 2003, 20:41:50 »
ok, here is the thing I am working on, never mind some of the other stuff going on, I am trying to learn some new techniques!  But you will see the pause I am talking about
could it be because it's trying to create those units on top of eachother?
« Last Edit: 05 Jul 2003, 20:46:10 by Zombie »

_hammy_

  • Guest
Re:Game pause
« Reply #5 on: 05 Jul 2003, 20:48:56 »
no, i dont think thats it... cause u said it pauses as soon as #create starts.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Game pause
« Reply #6 on: 05 Jul 2003, 21:15:30 »
OFP alwayz pauses wen u create units - no way 2 evade it (on stronger cpomps it pauses less - nd somtimes its unnoticable wen u creat lil amound of units)

dats cuz it loads new units 2 memory nd starts keepin track of em

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

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Game pause
« Reply #7 on: 05 Jul 2003, 21:31:06 »
argggh, OK, maybe I can hide the pause with a cleverly timed cutscene.  Will creating units this way help reduce lag tho?  The cpu doesn't have to keep track of the units until they are needed.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Game pause
« Reply #8 on: 05 Jul 2003, 21:40:27 »
Quote
Will creating units this way help reduce lag tho?  

yes it is - all da best big sized misions around wil have da thing - it reduce da lag a lot ;D - check dis TUT

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

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Game pause
« Reply #9 on: 08 Jul 2003, 03:43:01 »
I think I found a solution.  If I create 1 group that has all the different soldiers I want at mission start, then the createunit script doesn't pause things when I create the other groups.  A little strange but it works and I only have a few extra units running around in the beginning.  Probably caused by the computer don't have to run the vectors for the units when the are created because the vectors are already loaded at mission start.