Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: DollMaster on Tue 13/11/2007 05:00:29

Title: What is the best way to go about scripting random combat?
Post by: DollMaster on Tue 13/11/2007 05:00:29
I am testing out script in a small crappy game...

I made 3 rooms.  Starting, room2, and the fighting room.

When you move to room2, there is a random chance that Ego appears and moves  towards you.  On collision, both are teleported to another room...the fighting room.  I can figure out the turned based battle on my own...but my problem is that I coded this for one room. 

I am not a good scripter and do not understand custom functions well.  But I believe I am supposed to use global code and custom functions to accomplish this.  The global code needs to 1)determine if monster is there, 2)choose monster, 3)place a monster on the screen.

Without going into specifics, how do I create custom global code, and how would I go about using it in my rooms?  I do not even know where to go about placing it in the global code script.
Title: Re: What is the best way to go about scripting random combat?
Post by: Khris on Tue 13/11/2007 05:18:13
Without going into specifics:
<<(([[|| * READ FIRST *BEFORE* POSTING!!! (updated 29 August 2007) * ||]]))>> (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=14373.0)

BFAQ: Creating your own custom functions (http://americangirlscouts.org/agswiki/Scripting%2C_Code_%26_Interaction#Creating_your_own_custom_functions)