Home   Help Search Login Register  

Author Topic: everything in the circle...  (Read 641 times)

0 Members and 2 Guests are viewing this topic.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
everything in the circle...
« on: 15 Sep 2005, 23:25:59 »
i'm scripting a little summ'n summ'n, akin to a nuke; basically it destroys everything in a circular area. the way i've done it to date is less than optimal.

basically i've defined the centre point and then go round in ever increasing circles finding the closest object and setting its damage to 1. naturally, to keep it fairly fast i've set the degrees to increment by about 11.25 and the radius by about 5. this along with the eye candy makes it almost perfect.

almost is not good enough, however, as in the case of closely placed objects, nearestobject picks one and leaves the other - if there are enough objects in the area, some are inevitably missed. this destroys the effect of an all-encompassing fireball, what with loons running about inside going "ha ha you missed me"...

is there a way of building a fine enough mesh, using maths, to catch all objects within a 50 metre radius, while maintaining script speed?

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:everything in the circle...
« Reply #1 on: 16 Sep 2005, 00:03:46 »
{_x setDammage 1} forEach thislist?
and setPos the trigger to teh impact spot?
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:everything in the circle...
« Reply #2 on: 16 Sep 2005, 00:20:34 »
ah now, i should have explained, this is scripting only. nothing can be added to the editor. yep, a trigger would have been my guess too, but it needs to be exclusively scripted, so as to be addable to any mission/campaign without opening in the editor...

i'm currently gridifying the circle with half radii, quarter radii, eighth radii and so on. it's performing well enough, but as yet there are still those few good loons left standing...  :-\

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:everything in the circle...
« Reply #3 on: 16 Sep 2005, 00:39:55 »
eh, well im out then

All my ideas include at least one trigger.  :P
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:everything in the circle...
« Reply #4 on: 16 Sep 2005, 01:02:44 »
I think that some stuff would survive the blast. Granted loons sticking their fingers up at you totally unharmed would'nt be right but some stuff surviving is ok I think. Couldn't you run another one quickly after the first?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:everything in the circle...
« Reply #5 on: 16 Sep 2005, 01:09:13 »
that's the ticket - inspiration! i'll increase the degree increment, thus speeding up the blast, but then do it twice or three times slightly offset. that should catch everything within the same time.

coolio  8)

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:everything in the circle...
« Reply #6 on: 16 Sep 2005, 04:11:25 »
 I have an idea. Once the script is entirely done do one last nearestobject check at the end of the script and then check the distance of that object from the center of the circle.
 If the distance equals less then the radius, then re-exec the script. This will remove any remaining objects for sure, however it wont really look like an explosion but will work as a debugger.
« Last Edit: 16 Sep 2005, 04:12:00 by RujiK »
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:everything in the circle...
« Reply #7 on: 16 Sep 2005, 18:52:02 »
If it's used with a nuke they could die from the radiation ;D
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:everything in the circle...
« Reply #8 on: 17 Sep 2005, 18:59:40 »
thats some fast-acting radiation there eh tyger? ;D