AI Helpers [message #257529] |
Sun, 06 May 2007 04:38 |
|
jnz
Messages: 3396 Registered: July 2006 Location: 30th century
Karma: 0
|
General (3 Stars) |
|
|
Is it possible to get AI to follow you, but attack others?
|
|
|
|
Re: AI Helpers [message #257545 is a reply to message #257529] |
Sun, 06 May 2007 07:38 |
|
zunnie
Messages: 2959 Registered: September 2003 Location: Netherlands
Karma: 0
|
General (2 Stars) |
|
|
M01_Hunt_The_Player does that.
Place a bot(or botspawner) and put this script on the scriptstan,
when the bot spawns it will follow friendly players and attack enemies
when they get close.
Also, M03_Goto_Star can be used, then the GDI bot will attack
both Nod and GDI players..
This script would work well if you attach it to an engineer for
example. They will "attack" players on the same team and thus repair them
[Updated on: Sun, 06 May 2007 07:40] Report message to a moderator
|
|
|
|
Re: AI Helpers [message #257603 is a reply to message #257545] |
Sun, 06 May 2007 15:28 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
zunnie wrote on Sun, 06 May 2007 08:38 | Also, M03_Goto_Star can be used, then the GDI bot will attack
both Nod and GDI players..
This script would work well if you attach it to an engineer for
example. They will "attack" players on the same team and thus repair them
|
lol @ that. I remember that in MP's CoOp Beta mod. (And their server as well)
-MathK1LL
|
|
|
|
|
Re: AI Helpers [message #257659 is a reply to message #257529] |
Mon, 07 May 2007 02:48 |
|
futura83
Messages: 1285 Registered: July 2006 Location: England
Karma: 0
|
General (1 Star) Viva la Resistance! |
|
|
There must be a script in there for it...try M01 scripts, cos on that mission, once you have saved the church people, you get given reinforcements that will follow you if you go to them and press 'E'...
This is a signature. Reading this is wasting your time.
|
|
|
|
Re: AI Helpers [message #257664 is a reply to message #257661] |
Mon, 07 May 2007 03:42 |
|
futura83
Messages: 1285 Registered: July 2006 Location: England
Karma: 0
|
General (1 Star) Viva la Resistance! |
|
|
gamemodding wrote on Mon, 07 May 2007 10:53 | No, because they probably get the
M01_Hunt_The_Player
or
M03_Goto_Star
attached to them.
|
they will have, but they'll have also had a script or 2 more on it that made it so when you press E it follows you...ill try it out in leveledit now, and get back to you...
This is a signature. Reading this is wasting your time.
|
|
|
|
|
|
Re: AI Helpers [message #257685 is a reply to message #257529] |
Mon, 07 May 2007 07:32 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
Ask jonwil really nicely?
Dunno about the scripts..But that Screeny you sent me was cool...Wish I could've seen them actually "attacking" you.
-MathK1LL
|
|
|
|
|
Re: AI Helpers [message #257744 is a reply to message #257529] |
Mon, 07 May 2007 15:56 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
Well you cud script in a follow script which would be something like
Commands-> Set_Position(obj,Commands->Get_Position(Get_GameObj(Get_Int_Parameter("Player_ID"))))
or if you wanted to get the helper to follow where they face
int ID = Get_Int_Parameter("ID")
Vector3 pos = Commands->Get_Position(Get_GameObj(ID));
float f = Commands->Get_Facing(Get_GameObj(ID)) +180;
pos.X += -1.5*(cos(f*(PI / 180))); // 1.5 or any other distance
pos.Y += -1.5*(sin(f*(PI / 180)));
Commands->Set_Position(obj,pos);
|
|
|
|
|
Re: AI Helpers [message #257859 is a reply to message #257529] |
Tue, 08 May 2007 14:11 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
You need either a timer that lasts 0.0f seconds or u need to increase the distance away from the current player. Also which script are you talking about the first or the second?
|
|
|
|
Re: AI Helpers [message #257874 is a reply to message #257529] |
Tue, 08 May 2007 16:51 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
For the first one it will spawn in you so you need to add something like pos.X += 3;
for the second one make the distance 2 and attach that to the helper with a timer of 0.0f.
This wont show the helper moving but it will continuosly teleport to the position
|
|
|
Re: AI Helpers [message #257876 is a reply to message #257529] |
Tue, 08 May 2007 17:41 |
|
zunnie
Messages: 2959 Registered: September 2003 Location: Netherlands
Karma: 0
|
General (2 Stars) |
|
|
void z_FollowPoker::Created(GameObject *obj)
{
AllowPoke = true;
FollowID = 0;
Following = false;
Commands->Enable_HUD_Pokable_Indicator(obj,true);
}
void z_FollowPoker::Poked(GameObject *obj, GameObject *poker)
{
if (AllowPoke)
{
Commands->Enable_HUD_Pokable_Indicator(obj,false);
FollowID = Commands->Get_ID(poker);
Commands->Start_Timer(obj,this,0.5,789);
}
}
void z_FollowPoker::Custom(GameObject *obj,int message,int param,GameObject *sender)
{
if (message == Get_Int_Parameter("Stop_Following_Msg"))
{
Commands->Enable_HUD_Pokable_Indicator(obj,true);
AllowPoke = true;
Following = false;
FollowID = 0;
}
}
void z_FollowPoker::Timer_Expired(GameObject *obj,int number)
{
if (number == 789)
{
Commands->Innate_Disable(obj);
GameObject *GotoObject = Commands->Find_Object(FollowID);
if (GotoObject)
{
ActionParamsStruct params;
params.Set_Basic(this,100,100,-1);
params.Set_Goto_Following(GotoObject,5.0f,1.0f,true);
Commands->Action_Goto(obj,params);
Commands->Start_Timer(obj,this,0.5,789);
}
}
}
void z_FollowPoker::Register_Auto_Save_Variables()
{
Auto_Save_Variable(1,4,&FollowID);
}
Note sure what the bot will do if it encounters enemies, wether
it will continue to follow the player once that enemy is killed for example..
You can send a custom to the bot if you want it to stop following
the player, or attach another script to the player that will send
a custom to the bot when that player dies so it stops following
until someone else pokes him again.
May have to modify it a bit to enable/disable innate where needed..
ie: when destination reached, following=false, followid=0, and enable innate again etc.. that may work
[Updated on: Tue, 08 May 2007 17:52] Report message to a moderator
|
|
|
|