Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » AI Helpers
AI Helpers [message #257529] Sun, 06 May 2007 04:38 Go to next message
jnz is currently offline  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 #257543 is a reply to message #257529] Sun, 06 May 2007 07:12 Go to previous messageGo to next message
SeargentSarg is currently offline  SeargentSarg
Messages: 478
Registered: November 2006
Karma: 0
Commander
I remember there was a good mod called "Capture the Mobious" but Mobious never attacked Nod (or the other side for example) it was considered neutral.

Re: AI Helpers [message #257545 is a reply to message #257529] Sun, 06 May 2007 07:38 Go to previous messageGo to next message
zunnie is currently offline  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 Razz


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png

[Updated on: Sun, 06 May 2007 07:40]

Report message to a moderator

Re: AI Helpers [message #257550 is a reply to message #257529] Sun, 06 May 2007 08:11 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Thanks Smile

EDIT: is it possible to get them to follow a specific freindly player?

[Updated on: Sun, 06 May 2007 08:33]

Report message to a moderator

Re: AI Helpers [message #257603 is a reply to message #257545] Sun, 06 May 2007 15:28 Go to previous messageGo to next message
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 Razz



lol @ that. I remember that in MP's CoOp Beta mod. (And their server as well)


-MathK1LL
Re: AI Helpers [message #257633 is a reply to message #257550] Sun, 06 May 2007 19:42 Go to previous messageGo to next message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma: 0
General (2 Stars)

gamemodding wrote on Sun, 06 May 2007 11:11

Thanks Smile

EDIT: is it possible to get them to follow a specific freindly player?



Whats scripts.dll version are you using ?
Is this for a new map or for a serverside mod?


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png
Re: AI Helpers [message #257656 is a reply to message #257529] Mon, 07 May 2007 02:32 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
I'm using 3.2.2, its for a server side mod.
Re: AI Helpers [message #257659 is a reply to message #257529] Mon, 07 May 2007 02:48 Go to previous messageGo to next message
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 #257661 is a reply to message #257529] Mon, 07 May 2007 02:53 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
No, because they probably get the

M01_Hunt_The_Player
or
M03_Goto_Star

attached to them.
Re: AI Helpers [message #257664 is a reply to message #257661] Mon, 07 May 2007 03:42 Go to previous messageGo to next message
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 #257668 is a reply to message #257529] Mon, 07 May 2007 04:30 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
all that they have done is made the person pokeable, when poked the script is attached to it. I am not doing this in LE, but W/E is possible in LE is possible the way i am doing it. I have hit another snag, though, the AI only walk a certain speed that is way too slow. Is it possible to make them go faster?
Re: AI Helpers [message #257669 is a reply to message #257529] Mon, 07 May 2007 04:34 Go to previous messageGo to next message
CarrierII is currently offline  CarrierII
Messages: 3804
Registered: February 2006
Location: England
Karma: 0
General (3 Stars)

Make a clone of the preset you're using for the AI and adjust it?


Renguard is a wonderful initiative
Toggle Spoiler
Re: AI Helpers [message #257671 is a reply to message #257529] Mon, 07 May 2007 04:38 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
I think thats going to be how i do it, although, i don't want to use a diffrent objects.ddb. Is there a script i could attach mabe?
Re: AI Helpers [message #257685 is a reply to message #257529] Mon, 07 May 2007 07:32 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
Ask jonwil really nicely? Razz


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 #257706 is a reply to message #257529] Mon, 07 May 2007 12:11 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
Cant you just use Get_Team(id) and set the team of the bot to the other team?

[Updated on: Mon, 07 May 2007 12:12]

Report message to a moderator

Re: AI Helpers [message #257710 is a reply to message #257529] Mon, 07 May 2007 12:54 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
No, because it wouldn't follow me then.
Re: AI Helpers [message #257744 is a reply to message #257529] Mon, 07 May 2007 15:56 Go to previous messageGo to next message
a100 is currently offline  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 #257826 is a reply to message #257744] Tue, 08 May 2007 09:00 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3806
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Don’t use “m01_hunt_the_player”, because if they can’t get to the player in a certain amount of time they die, instead use “M04_Hunter_JDG” (its J** I don’t remember what the exact last two are but there are only two scripts dealing with hunting in M04, and the other is a controller).

Re: AI Helpers [message #257828 is a reply to message #257744] Tue, 08 May 2007 09:03 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
a100 wrote on Mon, 07 May 2007 23:56

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);



Hmm, does this make the charater "jerk" towards you? or does it run smoothy?
Re: AI Helpers [message #257859 is a reply to message #257529] Tue, 08 May 2007 14:11 Go to previous messageGo to next message
a100 is currently offline  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 #257869 is a reply to message #257529] Tue, 08 May 2007 16:07 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
both.
Re: AI Helpers [message #257874 is a reply to message #257529] Tue, 08 May 2007 16:51 Go to previous messageGo to next message
a100 is currently offline  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 Go to previous messageGo to next message
zunnie is currently offline  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


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png

[Updated on: Tue, 08 May 2007 17:52]

Report message to a moderator

Re: AI Helpers [message #257906 is a reply to message #257529] Wed, 09 May 2007 00:26 Go to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Thanks very much, ill try that when i get home today.
Previous Topic: Requesting Map Maker
Next Topic: Teleport Failure
Goto Forum:
  


Current Time: Sat Aug 17 10:19:25 MST 2024

Total time taken to generate the page: 0.01249 seconds