Home   Help Search Login Register  

Author Topic: spawn objects?  (Read 980 times)

0 Members and 1 Guest are viewing this topic.

Offline thedog

  • Members
  • *
spawn objects?
« on: 26 Jun 2008, 15:31:43 »
hey guys im pretty new around here, and im pretty new to scripting. i was making a training map with pop up targets ( target E the blue ones ) and i have about 6 firing ranges right now, in different locations and i will be adding more. to reduce lag i wanted each range to spawn once i get there and despawn once i leave, or on a radio command. ive been looking up and down on several websites, google, tried different script packs and so muchs for days now. all i need is a simple way to do it, or somebody to walk me through step by step.

objective is to spawn pop up targets ( objects ) once you reach a certain area, and despawn them when training is done and you have left the training site...

any help please?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: spawn objects?
« Reply #1 on: 26 Jun 2008, 15:38:18 »
I'm not sure that having a few firing ranges, even with hundreds of targets in total, will cause much lag really. Are you sure it is really making a difference? Although people do have "only spawn when I'm near" scripts, it is generally to prevent there being a lot of AI being active (since AI have to think as well as be displayed). Even then, it is when there are a large number of them and usually only in larger MP missions.

What you ask is certainly possible, but it seems an unnecessary effort (if it ain't broke, don't fix it).

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline thedog

  • Members
  • *
Re: spawn objects?
« Reply #2 on: 26 Jun 2008, 15:47:31 »
well the lag is just the minor problem, so far its still ok even with about 6 ranges having several hundred targets :) problem is, i want them to respawn once the fire team has walked through the area and "cleared" it, not just bring the targets back up, but also changing their locations ( i set them all to spawn in random spots and by respawning them i was hoping they would change spots to ) to keep concentration on the team running the training, also, since there will be multiple ranges and it will be on our realism units practice server i can see several units practicing their own thing, for example we might have our tankers do training south of sahrani, and inf do training north of sahrani, now if the tankers destroy all the targets on their range, and have to restart the map for the targets to respawn ( also in different locations ) then that would interrupt the INF training north, so i want multiple assets be able to do their own thing without interrupting others.

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: spawn objects?
« Reply #3 on: 26 Jun 2008, 17:18:16 »
what exactly do you want to respawn? the targets???

edit: ok this is what I found that may help you...

Using with objects:
In the following example a D30 gun will be generated at Position XYZ:
Ari1="D30" createVehicle [x,y,z]
By using the setDir command, it's looking like this:
Ari1 setDir 190
It might so happen that a vehicle can't be used after it has been generated. To avoid this,
the following order should be used as well:
Ari1 lock false

this was taken from the ArmA editing guide. an extremely useful tool! I hope this helps.

TCM
« Last Edit: 26 Jun 2008, 17:48:49 by Trash Can Man »