Jump to content

AI Scripting for newbies


Downs Duck

Recommended Posts

I would really like to flick a bit on the various AI scripts that are floating around, as would maybe some other newbies.

 

Of course there is issues with the authors of these scripts, but I would find it great if one could possibly have a pinned topic on this on the GMD forum.

 

Maybe one could start with adjusting the original scripts that came with the game.

 

Then one could have a list pinned to the forum, if so desired.

 

Like this (I don't know what on earth, so I am just guessing wildly:

1. Find your default, ranged, fighter, whatever script from your Scripts folder.

2. Open this script in [insert program here]

3. Modify the script to your hearts content.

 

4. Here you will find the list for triggers, there are hundreds to choose from (URL link)

5. Here is the list for actions (there are hundreds to choose from (another URL link)

6. Compile the script in [insert program here]

7. Save the compiled script in your scripts folder

8. Enjoy your newly created script you lucky child of non-married parents (being an insult from the older days as children now often have parents that are living together without being married)

 

Would someone mind filling in the blanks?

 

I know of this one from before, but I would really like some more info:

http://www.pocketplane.net/tutorials/simsc...ml#Introduction

 

EDIT: Removed word for children born from non-married parents

Link to comment
1. Find your default, ranged, fighter, whatever script from your Scripts folder.

2. Open this script in [insert program here]

use WeiDU to convert the .bs source to baf, then edit in ConTEXT. If you're afraid of the command prompt, use NI.

 

4. Here you will find the list for triggers, there are hundreds to choose from (URL link)

5. Here is the list for actions (there are hundreds to choose from (another URL link)

http://iesdp.gibberlings3.net

6. Compile the script in [insert program here]

Again, use either WeiDU for compiling, or use NI if you want a single program.

7. Save the compiled script in your scripts folder

And remember to rename from .bcs to .bs.

 

In NI, you don't have to backup your dialog.tlk - you need to choose a chitin.key, open the Scripts tab on the left, choose one, edit to your heart's content, and press compile in the lower of the screen.

 

Also, out of memory? how much RAM do you have, 128 MB?

Link to comment

I'm working on spiffing up the Crimson Editor highlighters for WeiDU D, BAF, and tp2 for BG2/Tutu/BGT - I definitely am partial to them over the ConTEXT editor program (but have also used ConTEXT - either editor will do the job.)

Link to comment

I am currently looking at the eFighter AI script and found this:

 

IF

Statecheck(Myself,STATE_POISONED)

Hasitem("POTN20",Myself)

Hppercentlt(Myself,50)

!Globaltimernotexpired("gh_SpellCastThisRound","LOCALS")

Or(2)

Actionlistempty()

Globaltimernotexpired("gh_ActionIsInterruptable","LOCALS")

THEN

RESPONSE #100

Setglobaltimer("gh_SpellCastThisRound","LOCALS",ONE_ROUND)

Useitem("POTN20",Myself)

Displaystringhead(Myself,7029)

END

 

Guessing that this is when a character gets poisoned, as I have no skills in programming from before?

 

Is it safe to say that if I edit the POTN to _POTN20, it would work in Tutu?

 

That seemed to be the trouble for all resources in another thread I started.

 

I have some sparetime, and would absolutely love :p to do this work.

 

I could go through the whole script(s) and adding underscore before every potion, but I guess there are other things than potions I should change too?

 

This way, we would have eScripts working as they should (hopefully) for Tutu.

 

EDIT: Also, if there are any other way of changing the scripts pot to _pot in another manner than one by one, I would prefer you guys told me sooner than later :p

 

EDIT: Removed provoking cheer for scripts maybe being able to work perfectly in tutu.

Link to comment

I didn't know case mattered so little. I know someo fo that should be along the lines of HasItem or HPPercentLT, etc.

 

For your own personal use, variable names won't matter, so you can leave them alone, but you should probably be aware that gh_SpellCastThisRound is the modder's variable, and gh is probably a personal prefix.

 

Apart from questionable capitalization, adding an underscore is usually enough. You are going to want to verify each and every resource against your Tutu install using NI or similar. Make sure potn20 is, in fact, _potn20. In this case, it is, but it gets funny. For example, sometimes the _ replaces the first letter. You're going to have to find all that out.

Link to comment
I didn't know case mattered so little. I know someo fo that should be along the lines of HasItem or HPPercentLT, etc.

:p

 

For your own personal use, variable names won't matter, so you can leave them alone, but you should probably be aware that gh_SpellCastThisRound is the modder's variable, and gh is probably a personal prefix.

:p

 

Apart from questionable capitalization, adding an underscore is usually enough. You are going to want to verify each and every resource against your Tutu install using NI or similar. Make sure potn20 is, in fact, _potn20. In this case, it is, but it gets funny. For example, sometimes the _ replaces the first letter. You're going to have to find all that out.

That part I did understand. Drop a Number 2 in my mouth and call me a scoundrel, that is a mess if I ever saw one.

 

EDIT: Removed feces related word, and replace it with something more of a child talking

Link to comment
I am currently looking at the eFighter AI script and found this:

<snip>

Guessing that this is when a character gets poisoned, as I have no skills in programming from before?

Is it safe to say that if I edit the POTN to _POTN20, it would work in Tutu?

Yes; you've found the path to enlightenment :p

 

I could go through the whole script(s) and adding underscore before every potion, but I guess there are other things than potions I should change too?

Well, if you want to use scrolls, wands, ... as well, you'd have to change those too.

 

EDIT: Also, if there are any other way of changing the scripts pot to _pot in another manner than one by one, I would prefer you guys told me sooner than later :p

you could do a search-and-replace from POTN to _POTN. However, you'll still have to double-check everything, so be prepared to get RSI and a pair of glasses.

 

Also, case matters in triggers/actions, but it doesn't for item names (= stuff in ""s).

Link to comment
Yes; you've found the path to enlightenment :p

Awesome.

 

Well, if you want to use scrolls, wands, ... as well, you'd have to change those too.

The minor nuisance...The minor nuisance...

 

Well, you could do a search-and-replace from POTN to _POTN. However, you'll still have to double-check everything, so be prepared to get RSI and a pair of glasses.

How do I do that? I am currently using DLTC Editor Pro v7 and there is only a search function, no replacement function that I can see. Maybe those other tools are better?

 

EDIT: Removed horrific jest towards the film "Apocalypse Now", and replaced it

Link to comment

Doesn't help that DLTCEP does not seem to have a hotkey for search either, so I'll have mouse-disease within 5 minutes of editing.

 

EDIT: Potions fixed (hopefully). Now to wands.

 

This is going to take time. Thank god for mp3's and Sleater-Kinney.

 

EDIT 2: Wands fixed (hopefully).

 

EDIT 3: I have stumbled into some sort of problem:

 

- I copied the eFighter.bs to My Documents folder.

- Renamed it eFighter.bsc to be able to edit it.

- Opened DLTCEP, opened the file and added the changes to potions and wands.

- Now it won't let me save my changes, the non-married parents child program :p

 

When I try to save, it tells me I opened it read only, but I never got a query in the first place?

The excact message: "You opened it read only!"

 

The file is not writeprotected, I checked.

Don't know what else to check or not.

Yet.

But hopefully I will learn.

 

EDIT: Inserted correct language instead of the one word for non-married parents child program

Link to comment

DLTCEP sucks disproportionate amounts of pigeon cock. Your best bet is to use WeiDU to convert your BS files to BAF, edit them in Context / Crimson Editor, and use WeiDU to compile them back to BCS (and rename the file to BS). If you're afraid of the commandline, you should be able to do that by putting weidu.exe in the BG2 directory, and drag-and-drop your BS/BAF files on weidu.exe. Otherwise, there should be a tutorial on command-line somewhere.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...