Home   Help Search Login Register  

Author Topic: Respawn one AI to his previous waypoints?  (Read 1936 times)

0 Members and 1 Guest are viewing this topic.

Offline D007

  • Members
  • *
Respawn one AI to his previous waypoints?
« on: 26 Aug 2008, 11:08:49 »
I must be loosing my mind or something..
I have tried grouping to game logics and grouping to an existing member..
2 things always happen.. with the gamelogic they don't move at all.

with the grouping to another living ai who can't get killed... they try to run to him..
I am pullin my friggin hair out over this and I'm sure it's simple..

any tutorials on creating units so they follow their old waypoints?
anything?
I can't release the new version til we get this friggin thing fixed.
I must be totally brain farting or something because I just can't get the script right.. idk..

This is where I am now.

Code: [Select]
?! (local server): exit
@ ! (alive sf3)
sf3 = group m2officer createUnit ["soldierwsaboteurrecon",sf2m,[], 0, "NONE"];
sf3 = (units m2officer) select 1
[sf3] join grpNull;
sf3 = group sf3
sf3 addweapon nvgoggles
sf3 addEventHandler ["killed",  {      _Killer = _this select 1;      _id=([man1,man2,man3,man4,man5,man6,man7,man8,man9,man10,man11,man12,man13,man14,man15,man16,man17,man18,man19,man20] find gunner _Killer)+1;  if(_id>0)then{["punishmentevent", _id] call SPON_publishGlobalEvent;}}];

and
Code: [Select]
?! (local server): exit
@ ! (alive sf3)
sf3 = group m2officer createUnit ["soldierwsaboteurrecon",sf2m,[], 0, "NONE"];
sf3 addweapon nvgoggles
sf3 addEventHandler ["killed",  {      _Killer = _this select 1;      _id=([man1,man2,man3,man4,man5,man6,man7,man8,man9,man10,man11,man12,man13,man14,man15,man16,man17,man18,man19,man20] find gunner _Killer)+1;  if(_id>0)then{["punishmentevent", _id] call SPON_publishGlobalEvent;}}];

(Trying different methods)
Tried doing the deletegroup command.
Just before I respawn the unit in the script and inside the init of the unit at the start of the mission.
It semi-works but I get an error.
The unit does however respawn and return to his previous waypoints.

Ug... thanks for your time. sorry to bug so much..
Maybe theres a site or something someone might be able to point me to.
A place that has detailed tutorials, of the "how to not suck at editing/scripting arma" variety?
I hate to bug people. But after the third day of trying this .. I'm done..
« Last Edit: 26 Aug 2008, 12:11:19 by D007 »

Offline i0n0s

  • Former Staff
  • ****
Re: Respawn one AI to his previous waypoints?
« Reply #1 on: 26 Aug 2008, 14:02:17 »
Should the AI instant respawn? Should the AI respawns when their group get killed? How big is the group?
When a unit gets killed he will leave that group after a while (faster when some group members report his death). Until that time, you can get the waypoints of that group and save them (at least their positions).
So you just take the killed-eventhandler (because the group still is attached to the unit) and save the waypoints and attach them to the new group

Offline D007

  • Members
  • *
Re: Respawn one AI to his previous waypoints?
« Reply #2 on: 26 Aug 2008, 15:21:58 »
It's just a single unit.
I would like him to respawn on trigger activation.

Trying to get him to respawn and keep his waypoints.

There is no "group" really.. all individuals with different waypoints.
I didn't realise you could "save waypoints" though.

The situation is like this.. a convoy truck drives into a trigger..
that trigger activates a respawn script for any that are dead.
I just need them to return to their waypoints
and I figure to dot hat they need to keep their name and group.

Thanks for the response. :)

Offline Crowey

  • Members
  • *
Re: Respawn one AI to his previous waypoints?
« Reply #3 on: 26 Aug 2008, 16:33:03 »
how do you get ai to respawn???

Offline i0n0s

  • Former Staff
  • ****
Re: Respawn one AI to his previous waypoints?
« Reply #4 on: 26 Aug 2008, 16:49:15 »
Are that special waypoints? How are they created etc.?
Already tried it with addWaypoint?

Offline D007

  • Members
  • *
Re: Respawn one AI to his previous waypoints?
« Reply #5 on: 26 Aug 2008, 19:26:04 »
idk what addwaypoint is..lol
Made the waypoints in the editor..
when you respawn a group/person, as long as someone in that group is alive.
you can make them return to their waypoints, that were created in the editor for those people.

I can respawn one man within like 5 seconds maybe if im lucky and his group hasnt deleted.
but if you wait more than a few seconds tops that units group will no longer be valid to join..
unless maybe you use the delete group command which im not to familiar with..


so the question is.. how can you make waypoints in the editor and have the individuals assigned to those waypoints,
return to those same waypoints, when they respawn..  :dunno:
 


how do you get ai to respawn???

Don't hijack my topic..
make your own.
« Last Edit: 27 Aug 2008, 14:14:02 by D007 »