Home   Help Search Login Register  

Author Topic: Spreading out those logics  (Read 592 times)

0 Members and 1 Guest are viewing this topic.

Dubieman

  • Guest
Spreading out those logics
« on: 21 Feb 2005, 23:10:56 »
Hello,

I have an array  _logics = [gl1,gl2,...,gl9,gl0]

And I want to place each one at random spots around the group/leader _target at least 50m away.

So (imagine in your head) a circle around the groups leader and I want game logics randomly placed on that circle like a planet's orbit around the sun, not moving.  :P

Sorry if I confuse anyone, I want all those game logics placed at random areas around the _target and at least 50m away. And I'm unsure on how to code it. :P

Help appreciated ;)

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Spreading out those logics
« Reply #1 on: 21 Feb 2005, 23:20:36 »
How about this:

_dist =  50
_theta = random 360
_x = (getPos loon select 0) + _dist * sin(_theta)
_y = (getPos loon select 1) + _dist * cos(_theta)


This will place the GLs randomly on the circumferance of a circle radius 50 centred on the loon

If you want the GLs to be scattered across the surface of the circle then use

_dist = random 50

Edit:
Quote
at least 50m away
Do you mean that or do you mean exactly 50m away?

If you want them to be > 50 and less than say 200 use

_dist = 50 + random 150


« Last Edit: 21 Feb 2005, 23:24:50 by THobson »

Dubieman

  • Guest
Re:Spreading out those logics
« Reply #2 on: 22 Feb 2005, 01:28:37 »
Thobson, thanks for the code. I don't really know which of those little pieces of code I'm going to use as I don't know what I want the script to do in detail yet. ::) :P


Thanks
 ;)
« Last Edit: 22 Feb 2005, 01:28:54 by GuiltyRoachKillar »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Spreading out those logics
« Reply #3 on: 22 Feb 2005, 03:41:13 »
just out of curiousity, what do you need gls placed in a circle around people for?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Spreading out those logics
« Reply #4 on: 22 Feb 2005, 16:40:45 »
the gamelogics have a "Placement Radius" setting

you could place the gamelogic at the start location of the leader unit
and use the placement radius to achieve your aim

NB>>>> this would only work at the mission start

you could not setpos a gamelogic to the leader units location, it would simply setpos directly to him
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Spreading out those logics
« Reply #5 on: 22 Feb 2005, 17:18:36 »
That's a good suggestion if he wants the GLs anywhere within a circle around something, I think he wants them all on the circumferance of the circle though

Dubieman

  • Guest
Re:Spreading out those logics
« Reply #6 on: 22 Feb 2005, 17:18:47 »
A master plan to rule the world. ;)

j/k

Its for an idea/script I'm toying with that has to do with a sort of random attack deal. :P  Not quite sure what's going in it yet, but I'm gonna have to test its effects.

@Terox: I can't use placement radius since I'm going to need this "circle" of GLs to follow the target continueally throughout the mission/situation.


Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Spreading out those logics
« Reply #7 on: 22 Feb 2005, 17:59:23 »
Why would you need GLs to follow the player?  Could you not calculate the appropriate position whenever you need it?  Triggers following units I can understand but not GLs.

Are you going to spill the beans on what you are doing? :)
« Last Edit: 22 Feb 2005, 17:59:38 by THobson »

Dubieman

  • Guest
Re:Spreading out those logics
« Reply #8 on: 23 Feb 2005, 02:08:15 »
Unit starts...unit has a circle of GLs around him. Unit moves...after delay the game logics are moved back into a circle around him (like guys falling back into formation).

And its to experiment with a way to make the hunted scripts better so if you run one way, ppl won't always be behind you, sometimes they will attack from your side or in front or 45 degrees to your right...etc.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Spreading out those logics
« Reply #9 on: 23 Feb 2005, 14:37:33 »
if its just to get ai to attack from a certain direction

then what you need is

a script that randomly sets a groups "move waypoint" to a relative position to the hunted unit

what i would do is

1) Have 3 waypoints
..... a)  WP (Number 0) = "move" waypoint [executes a script that relatively sets the position of waypoint number 1
..... b) WP (Number 1) = "move" waypoint
[executes a script that sets wp number 2 to the target

you can play about with all sorts of combinations of this

more move waypoints, maybe wp 0 and wp 1 cycle each other until the units are within a certain distance of the target, if so a global boolean is then initiated, which allows wp number 2 to be activated, breaking the cycle & setpos'd to the target

have s&d wp's
..... b) WP (Number 0) = "move" waypoint
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Dubieman

  • Guest
Re:Spreading out those logics
« Reply #10 on: 24 Feb 2005, 04:19:30 »
Good ideas, I'll see if I can get to them. Too many other things in the works right now. :P

Thanks everyone ;) :)