Home   Help Search Login Register  

Author Topic: Reporting contacts without event handlers  (Read 969 times)

0 Members and 1 Guest are viewing this topic.

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Reporting contacts without event handlers
« on: 30 Nov 2003, 13:46:52 »
Hi there, ppl  8)

For the next version of my SpawnManager (3) i'm trying to come up with a simple & fast system for reporting enemy contacts to a central SpawnManager-AI. And it has to be multiplayer-compatible. Event handlers are still a problem in MP, no ? (or did i miss something ?)


I want to base this on group behaviour, like: if a group's behaviour changes to 'COMBAT' there must've be an enemy sighted.
Of course, this also means i can't issue a direct setbehaviour "combat" - command to my groups, but that's ok.

So basically i permanently loop thru all my patrolgroups if a group has switched to "COMBAT". Then i use a big trigger that covers the whole map to get a list of all enemy units and by checking against "knows about > 2" find the enemy unit that the patrolgroup-leader sighted.

After that i want to get what type the enemy unit is (Officer, AT, AA etc) or what vehicle he drives, and then report the info to the SpawnManager3 AI. Based on the reported threat-type specific groups are spawned that will have the best chance to fight off the threat (Choppers vs. Tanks, lots of Infantry vs. Commandos/Snipers, AA-Infantry vs. Choppers etc etc).


Basically SpawnManager3 will be a global AI that uses many SpawnManager2-scripts as 'portals' to fight specific threats.

Comments ? Helpful script pieces anyone ? Problems you see for use in MP ?
I appreciate any info you may throw in here. Thx in advance, ppl.  :)

Offline alimag

  • Contributing Member
  • **
  • I'm a llama!
Re:Reporting contacts without event handlers
« Reply #1 on: 01 Dec 2003, 17:59:24 »
Hi,

Are you sure that the behaviour changes on contact?

I was under the impression that since 1.85 the behaviour command will return the last behaviour assign to the group and not the temporary behaviour triggered by enemy proximity. I may be wrong...

Where can I find SpawnManager 2 so I can have a look at it?

Cheers
AliMag

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Reporting contacts without event handlers
« Reply #2 on: 01 Dec 2003, 19:21:22 »
Can be DLed here: http://www.ofpec.com/editors/resource_view.php?id=585 (units and groups)

Yes, it is possible to use the behaviour. To tell if an AWARE unit has been 'alarmed', check for behaviour == "COMBAT".

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Reporting contacts without event handlers
« Reply #3 on: 02 Dec 2003, 04:23:22 »
DrStrangelove,

maybe this might be worth, giving it a try to use the
countEnemy command.

unitX countEnemy arrayX

returns the number of known enemies from arrayX to unitX

I can only assume the right syntax for checking it out for more
than one guy (:note - i'm at work right now so i can't test it, and i'm a lil bit pissed too  :-[ ), but here we go:

#loop
~1
?"if (_x countEnemy enemy_array > 0) then {goto {skip}}" forEach friendly_array
goto "loop"
#skip
"_x setCombatmode {RED}" forEach friendly_array

:note - forgive me, if the syntax is wrong, i'll give this a try
for myself after reincarnation (*hell is should have denied the last 4 rounds of beeeeeers  :P *)

~S~ CD

Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Reporting contacts without event handlers
« Reply #4 on: 02 Dec 2003, 18:55:02 »
Thx very much Chris.

I could use this to check whether there are enemies in the global trigger list or not.
* DrStrangelove writes down code for later use[/i]  ;D

CptBravo

  • Guest
Re:Reporting contacts without event handlers
« Reply #5 on: 01 Dec 2004, 03:12:59 »
Hey

How is SPAWN MANAGER 3 going? Any release date yet??!
I think its one of the best Respawn scripts out there and I use it exclusively in our missions.

A couple of quick questions regarding SPAWN MANAGER 2:

Anyway to name a respawned group so you have group east1 respawn in tent o1?

Is it possible to have the respawned group join an existing group when it falls below a certain level??

Thanks for a great script! :)