Question about AI scripts

Please post here for questions and discussion about scenario design, art and sound modding and the game editor for WITP Admiral's Edition.

Moderators: wdolson, MOD_War-in-the-Pacific-Admirals-Edition

Post Reply
User avatar
Sardaukar
Posts: 11322
Joined: Wed Nov 28, 2001 10:00 am
Location: Finland/Israel

Question about AI scripts

Post by Sardaukar »

Is it possible for AI script part to have an end date and then AI switches to another part of script? That would prevent AI repeatedly trying to invade place it cannot capture. Or is this a feature already?
"To meaningless French Idealism, Liberty, Fraternity and Equality...we answer with German Realism, Infantry, Cavalry and Artillery" -Prince von Bülov, 1870-

Image
Oberst_Klink
Posts: 4839
Joined: Sun Feb 10, 2008 7:37 pm
Location: Germany
Contact:

RE: Question about AI scripts

Post by Oberst_Klink »

ORIGINAL: Sardaukar

Is it possible for AI script part to have an end date and then AI switches to another part of script? That would prevent AI repeatedly trying to invade place it cannot capture. Or is this a feature already?
Scipts have a start and end date, but there is no such thing AFAIK as an event editor if script a ends, then start script b.

Klink, Oberst

Image
Attachments
cats.jpg
cats.jpg (177.09 KiB) Viewed 106 times
My Blog & on Twitter.
Visit CS Legion on Twitter & Facebook for updates.
janh
Posts: 1215
Joined: Tue Jun 12, 2007 12:06 pm

RE: Question about AI scripts

Post by janh »

ORIGINAL: Sardaukar
Is it possible for AI script part to have an end date and then AI switches to another part of script? That would prevent AI repeatedly trying to invade place it cannot capture. Or is this a feature already?

Not perfectly sure what exactly you are aiming at, but the "Previous" Field in the AI scripts allows linking scripts. The manual says:
"Previous is used to chain scripts together. Before the next script can become active the previous script must be in defend mode or dead."

A while ago I was also wondering whether that together with the "Trigger Base" set and the "Rear Guard" test conditions (as these are among the few things the script AI can effectively "be asked to test" for smartly running or stopping scripts) could be used to create some sort of basic "if then or do while" logic in order to control the offensive and defensive scripts.

Kind of loop an active "rearguard" script for a couple of weeks, transit to a passive one for reconsolidation for a few more weeks, and switch back to the active "rearguard" script if one of the assault bases is still enemy owned.

However, there is no such alternative like setting a running duration instead of a fixed end date, right? And no way to allow a script to branch either of two (or more) paths, depending on some sort of trigger (e.g. Assault base still enemy owned by end date?), or has anyone found a means to do this?
Post Reply

Return to “Scenario Design and Modding”