Home   Help Search Login Register  

Author Topic: Lag issue  (Read 620 times)

0 Members and 1 Guest are viewing this topic.

Gooner861

  • Guest
Lag issue
« on: 15 Nov 2004, 16:38:13 »
Phew three posts in one day, its been a while.

Anyway just one little question. New mission im making where there is alot goin on. U start off in a big camp and move through a big chunk of the island. So to make it look good i've used alot of tents etc etc in the camp.

They've all been numbered but i wanna know how to get rid them once you leave the camp to help reduce the lag. Now i know about deletevehicle this and all that but how do i do it on such a large scale. I mean there are gonna be ALOT of objects to delete, but how would i go about doin it.

For example, if you've played Sui's Facile Ground he has a HUGE base camp. How did he delete all those!!!

Cheers yet again,

Gooner

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Lag issue
« Reply #1 on: 15 Nov 2004, 16:55:07 »
You could put all their names in an array and then have a looping script.

But what happens if the player goes back to the camp?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Lag issue
« Reply #2 on: 15 Nov 2004, 17:15:04 »
"deleteVehicle _x" forEach [tent1, tent2]

Syntax not guaranteed.    If you've seen it done in a mission, unpbo it and have a look.

If you're clever you can even automate the tent1, tent2 bit.   Can't remember exactly how, but you have a loop with a counter incrementing by one on each pass:  add the counter to the string "tent" each time.
Plenty of reviewed ArmA missions for you to play

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Lag issue
« Reply #3 on: 15 Nov 2004, 17:55:04 »
Hey there !

Here is a nice way of doing things. The idea is to spawn the tents rather than put them in the editor. You'll thereby have nice rows of nicely displayed tents, but the big advantage is that you'll be able to give the spawned tents names in no time.
When you don't need them anymore, it won't take much longer to deletevehicle them.

Here we go :

Code: [Select]
_i=0
#lp
call format ["tent%1={camp} createvehicle [(getpos MyObject select 0),(getpos MyObject select 1) + 5*%1]",_i]
_i=_i+1
?_i<MyNumberOfTents : goto "lp"

This will create a north-south line of 25 tents named tent0 to tent24.

Now, to delete them, just call another script :
Code: [Select]
_i=0
#lp0
Call format ["deletevehicle tent%1",_i]
_i=_i+1
?_i<25 : goto "lp0"
exit

Note that if you don't want to spawn the tents, you can still place them in the editor, give them all a name immediately followed by a figure, and use the last script all the same.



Hope that helps !


Ig.


Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Lag issue
« Reply #4 on: 16 Nov 2004, 07:03:19 »
For example, if you've played Sui's Facile Ground he has a HUGE base camp. How did he delete all those!!!

"deleteVehicle _x" forEach [tent1, tent2]

Pretty much that ;)

It took me about a week to name all the tents ;D
I've got a feeling I used a format command to prevent me typing out a whole array of 120 or so tents... I can't remember off the top of my head. I'll have a look when I get home.

I thought that there's got to be an easier way... I tried detecting them in a trigger, but because they aren't 'alive' it wouldn't pick them up.
Give Igor's method a go if you can. It sounds much more intelligent than mine ;D

DBR_ONIX

  • Guest
Re:Lag issue
« Reply #5 on: 16 Nov 2004, 17:27:07 »
What about a trigger
And use the thislist foreach thing?
- Ben

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Lag issue
« Reply #6 on: 16 Nov 2004, 17:56:12 »
Quote
I thought that there's got to be an easier way... I tried detecting them in a trigger, but because they aren't 'alive' it wouldn't pick them up.

 :P

:beat: *Gets Shot* :beat: