PLUGIN ... Random AI Aggression?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

PLUGIN ... Random AI Aggression?

Post by Merr »

Pip,

I'm experimenting again, but with the StartTurnPost ....

In theory, your VP PLUGIN uses the StartTurn to issue the aggression (34) when a hostile VP is taken ... right?

So, I'm trying to see if randomizing the aggression in StartTurnPost (afterwards) would work ... Hard to tell :roll:

The code below assumes I have only TEAM #1 change aggression ... 33% chance it won't change from 34.

Code: Select all

FUNCTION StartTurnPost(side)
{
int i ;

	// alternate AI Team Aggression ... does it work?
	if(side == 1)
	{
		i = Rand(1,3) ;
		
		if ( i == 1 )
		{
			SetTeamAggression(1, 1, 64) ;
		}
		if ( i == 2 )
		{
			SetTeamAggression(1, 1, 0) ;
		}
	}
}
Am I on the right track?
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

IIRC the aggression isn't changed when a VP is taken, the plugin simply uses the aggression settings to make units which are going after VPs move appropriately and attack stuff.

I see no reason your code wouldn't work.

Cheers

Pip
Post Reply

Return to “Battle Academy : Modders Corner ”