Jump to content

How to create AI scripts


Recommended Posts

Hi,

I was wondering if there is a tool available to help create scripts for newly created creatures. I have made several new summon spells and want them to act in a way similar to the way hostile creatures do when using SCS or other similar mods. A lot of scripts which I can see currently via NI all have actions which are solely to be used against the PC and party. The aim is to make unique scripts for creatures which are different, but the technical scale in which some of the scripts I have seen is beyond me. Any help would be appreciated.

Thanks!

Link to comment

SCS definitely isn't an entry-level example here; it uses a rather complicated system including its own scripting language to build its scripts at install time. If you're interested in that system, DavidW posted a set of lessons here: https://www.gibberlings3.net/forums/topic/13725-coding-scripts-in-ssl-some-lessons/#comment-118260

If you want something simpler ... the fundamental unit of a BCS/BAF script is a block.

IF
  // Conditions
THEN
  RESPONSE #100
    // Actions
END

Or you could introduce some randomness by having multiple RESPONSE sections; the block will then choose one at random, weighted based on the numbers.

When this script's turn in the execution order comes around, go through the script's blocks in order until you find one that you meet the conditions for. Then execute its actions, and don't keep going in the script (unless the last action is "Continue()"). So, earlier blocks are higher priority. Figure out what conditions you want your creature to use its ability under, figure out the actions, and then place it in the script based on the priority you want.

For one-time actions like buffs at the start of a battle, you use a variable; test it in the conditions, set it in the actions so it won't repeat.

Edited by jmerry
Link to comment

Thank you for the responses. I have given them unique abilities and some are spellcasters, I do want them to be able to use their abilities/spells in certain situations/to check if the target is sucesptible to the effect and use accordingly. The idea is to have them AI controlled and follow the PC, having to micromanage multiple summons is a bit much when there is already so much going on. 

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...