Coh3n
2010-06-24 18:58:58
[INDENT]Alright, so I've started to work on this, and I'm going to continually update this thread as it goes for any input you guys may have. If you haven't already, please read Switching to "Script Based". As the idea expanded, I've decided to rewrite it so there is very little required to add a new script. What I'm hoping to do is have it so literally all you need to add is a script record, object records, and item records. That being said, how often does something go exactly as planned? :rolleyes:
The TScript Record
[PHP]
{ type TScript
Description: Stores information for MSI's supported scripts }
type
TScript = record
scriptName : string; //used for the progress report
scriptRuntime : integer; //used for the progress report
scriptTools : TIntegerArray; //the required tools for the script
skillName : string; //used for the progress report
skillConstant : integer; //the skill constants are in Players.scar (SRL)
objectConstants : TVariantArray; //the default objects to be autoed; // -> these are variant arrays
objectExperiences: TVariantArray; //the default experienced gained from each object // to avoid type mismatch // errors with the Player
itemNames : TVariantArray; //used for the progress report // global variables
itemConstants : TVariantArray; //used for setup and throughout MSI //
doesBank : boolean;
pathRefTo : TPointArray; //not TTile array because we want it to compile without reflection
pathRefFrom : TPointArray;
pathColorTo : TIntegerArray;
pathColorFrom : TIntegerArray;
playerSkillLevel : integer;
playerGainedExp : integer;
playerLoads : integer;
playerItemAmounts: TIntegerArray;
end;
[/PHP]
Other Changes
I have attached an updated .diff file for everything I've changed. I have tested a little bit with both banking and powerchopping and everything seems to be working perfectly. I will be updating all the MSI guides accordingly, plus expanding on most of them. :) Any testing is greatly appreciated.
I have committed my changes, if for some reason there is a major bug, you can always revert back a revision. :)
Cheers,
Coh3n[/INDENT]
The TScript Record
[PHP]
{ type TScript
Description: Stores information for MSI's supported scripts }
type
TScript = record
scriptName : string; //used for the progress report
scriptRuntime : integer; //used for the progress report
scriptTools : TIntegerArray; //the required tools for the script
skillName : string; //used for the progress report
skillConstant : integer; //the skill constants are in Players.scar (SRL)
objectConstants : TVariantArray; //the default objects to be autoed; // -> these are variant arrays
objectExperiences: TVariantArray; //the default experienced gained from each object // to avoid type mismatch // errors with the Player
itemNames : TVariantArray; //used for the progress report // global variables
itemConstants : TVariantArray; //used for setup and throughout MSI //
doesBank : boolean;
pathRefTo : TPointArray; //not TTile array because we want it to compile without reflection
pathRefFrom : TPointArray;
pathColorTo : TIntegerArray;
pathColorFrom : TIntegerArray;
playerSkillLevel : integer;
playerGainedExp : integer;
playerLoads : integer;
playerItemAmounts: TIntegerArray;
end;
[/PHP]
Other Changes
- There's now a relocation feature that will relocate the player if an object isn't found. Right now, it only relocates if it can't find a bank as I need to talk to marpis more about is object finding functions to figure out exactly where to put the relocating.
- Each script record includes a default objects list for that script. For example, the powerchopper will cut all the supported trees if they're found (NCDS, I haven't added your idea yet, but I haven't forgotten, don't worry ;)). However, there is still a PlayerObjects array in DeclarePlayers so the user can choose whatever objects they want. By default, the script will auto the default objects. If the user fills in the PlayerObjects array, it will overwrite the default objects. :)
- There is no longer a bitmap element to TItem as we felt it was unnecessary and that DTMs and colour finding would suffice.
- There are 100s of other small things that have been changed, so if you're really curious, check out the .diff file I have attached.
I have attached an updated .diff file for everything I've changed. I have tested a little bit with both banking and powerchopping and everything seems to be working perfectly. I will be updating all the MSI guides accordingly, plus expanding on most of them. :) Any testing is greatly appreciated.
I have committed my changes, if for some reason there is a major bug, you can always revert back a revision. :)
Cheers,
Coh3n[/INDENT]