Page 1 of 1

Helping the AI ... FUNCTION AI_EndTurn()

Posted: Mon Dec 06, 2010 3:45 pm
by Merr
Pip and Ian,

I'm proposing a new function for the AI .... FUNCTION AI_EndTurn(side, team, me, target).

The script would allow the AI to make a "last minute check" on unit facings before the turn ends.

I think this would help the AI .... I really hate it when the AI leaves his Tiger's butt facing me at the end of it's turn.

The facing direction can be based on which target(player) will hurt me(ai) the most.

Winner?

Posted: Mon Dec 06, 2010 3:57 pm
by Merr
or ... better yet ... make it a wildcard function after EndTurn_???? ...

This way, if you add a trigger to look for "EndTurn" functions, it can run any scripts.

Examples ....

FUNCTION AI_EndTurn_Facing(side, team, me, target) ..... checks facings before ending turn.
FUNCTION AI_EndTurn_Rally(me) .... rallies units before ending turn (if AI has bonus).
FUNCTION AI_EndTurn_Ammo(me) .... recharges units before ending turn (if AI has bonus).

Winner, winner, chicken dinner?

EDIT .... BTW, the above functions are what I do before I end the turn ... lets get the AI to think like me, or rather the player? :wink:

Posted: Mon Dec 06, 2010 4:12 pm
by Merr
Hmm ... I just figured out how to do this ... using reverse logic.

We have the StartTurn function ... Normally we use IF side (1), then perform script for side(1). But, using reverse logic, IF side(0) turn, then perform side(1) script.

Basically, the EndTurn for the AI is the StartTurn for the human ....

Anyway ... I like my EndTurn idea .... but since it can be flip-flopped(logically) .... then disregard (maybe?).

:wink:

Posted: Mon Dec 06, 2010 5:04 pm
by pipfromslitherine
Great suggestion - adding to the tasklist right now!

Cheers

Pip

Posted: Mon Dec 06, 2010 5:15 pm
by adherbal
IIRC there's a function called StartTurnPost which is executed after everything else - that might work for such AI additions?

Posted: Mon Dec 06, 2010 5:34 pm
by Merr
adherbal wrote:IIRC there's a function called StartTurnPost which is executed after everything else - that might work for such AI additions?
Hmmm .... I wonder if adding an AI call in front would be recognized? ... eg FUNCTION AI_StartTurnPost() ...

If so .... then the potential for that function has been staring me in the face all this time! :?:

Posted: Mon Dec 06, 2010 6:29 pm
by junk2drive
Merr you have great ideas. Sometimes the trees get in the way of the forest. Glad you bounce them around here. Ideas, not trees.

Edit to add: Another game has option buttons. Armour Facing Rules on/off is one of them since the AI can't use the logic. I makes tanks have the same armour value (frontal) for each angle.

Posted: Mon Dec 06, 2010 7:09 pm
by Merr
junk2drive wrote: Edit to add: Another game has option buttons. Armour Facing Rules on/off is one of them since the AI can't use the logic. I makes tanks have the same armour value (frontal) for each angle.
I know what game you're thinking off ... I run it the same as you ... for that reason. All those updates and they never touched the AI's logic, which disappointed me.

You know Junk ... you gave me an idea that I'm going to toss in my TrackHit! mod ....

We've all experienced it .... when that Tiger is facing it's rear at me, you can pop it and cross your fingers ... Well, what's the Tiger going to do if he reacts? He'll spin his turret around but leave his butt facing you. So, here's the plan .... I'm going to add a random chance (say 50%) that if the unit reacts it will turn the entire unit (not just the turret) at you. So, you still have a chance to slap him on the butt, but now you have to pray to the "Ream-domizer" and hope the tank won't spin to face you!

The whole point of my TrackHit! mod is to immobilize the tank ... if he can't spin around because he's broken, he's a sitting duck!

You'll see Paul ... you'll see :wink:

Posted: Mon Dec 06, 2010 7:16 pm
by junk2drive
I've been playing plenty as US with Shermans that can't seem to get anything but an orange text. I might be happy to see a yellow or white for track hit. Wait till you face a Souma or Char B with a PZIII.

Posted: Mon Dec 06, 2010 9:28 pm
by Merr
junk2drive wrote:I've been playing plenty as US with Shermans that can't seem to get anything but an orange text. I might be happy to see a yellow or white for track hit. Wait till you face a Souma or Char B with a PZIII.
I didn't add text to show chance to hit or destroy a track ... The text is still based on the units hull facing and armor value.

So, even if the Sherman shows orange text with 0% chance to kill, you might still hit the track/suspension, even more so if you use the AimLow command, which focuses the shot on the lower hull and track.

Yeah, I can't wait for BAF ... thanks for testing it for us!

Posted: Thu Dec 09, 2010 3:00 am
by junk2drive
Teaser for Pip

Image

Posted: Thu Dec 09, 2010 4:33 am
by Merr
junk2drive wrote:Teaser for Pip
Junk,

You know .... When you have a moment, I need another button please ... Repair Button ... If you can take the image used for the PLUGIN (from the editor, you know the "tools" looking thing) and shrink it up and make a button, that would be great!

Then my engineer's (and tank crews) can repair track/suspension/engine damage.
I'm going to make the bailed out crews have another purpose besides being cannon fodder :wink:

Thank you sir! PM me when you get a chance ... appreciate ya!

BTW, you know when you move a tank and it "breaks down" ... "We've thrown a track!" .... well, they actually do now ... If you throw it twice you are immobilized ... :shock: ... that is, until you get someone to fix it. Throwing one track aint too bad, max AP will be 8, slows you down a bit .... but annoying ... The definition of "track" can mean any part of the suspension, eg wheel, bolt, screw, etc.

Posted: Thu Dec 09, 2010 5:15 am
by junk2drive
Done

Posted: Thu Dec 09, 2010 4:14 pm
by pipfromslitherine
I can't wait to see the campaign from you guys with all this cool stuff in :).

Cheers

Pip

Posted: Wed Dec 22, 2010 1:26 am
by Merr
Junk?

Can you move this thread over to Modder's Corner?

I've come up with a plan to make this happen and it should be a modding subject anyway.

Thanks.