Marzipan wrote:Anyway, anyone able to help me out here? And please keep in mind I always use the GUI...I've had a bad migraine all day as it it, last thing I need right now is to have to stare at a bunch of code.
errr..... too late, laughs ... well don't keep reading my post until your migraine is long gone, laughs...
----------
I'm not a coder, so my knowledge is limited, and thus my code method is rather extremely messy~ugly~long ...
it seems like 'delegates' is the way to do this more advanced parsing stuff, as far as I am trying to understand, lol.
-----
my (ugly~messy) way is using lists+dictionaries (you're going to need to read up on 'StringListItem', 'ObjectListItem', 'StringDictionaryItem', 'ObjectDictionaryItem', and~or 'ScriptDictionaryItem' )* :
* or, for another way of returning a Value, simply use Functions (an example):
(you can return any Attribute Type, such as a String, not just an Integer, as is shown in my example below)
player.damage = player.weapon.damage * critical_hit_function
<function name="critical_hit_function" type="int">
if (RandomChance (33) ) {
value = 2
} else {
value = 1
}
return (value)
</function>
lists' + Dictionaries', INDEXING starts at ZERO (and from left to right), not from one:
game.gender_stringlist = split ("male;female", ";")
0: male
1: female
<gender_scriptdictionary type="scriptdictionary">
<item key="male">
show menu ("Hair Style", split ("spiked; mohawk", ";"), false) {
player.hair_style = ToString (result)
}
</item>
<item key="female">
show menu ("Hair Style", split ("ponytail; pigtails", ";"), false) {
player.hair_style = ToString (result)
}
</item>
</gender_scriptdictionary>
game.gender_stringlist = split ("male;female", ";")
player.gender_string = ToString (StringListItem (game.gender_stringlist, GetRandomInt (0, ListCount (game.gender_stringlist) - 1) ) )
invoke (ScriptDictionaryItem (game.gender_scriptdictionary, player.gender_string))
----------
some examples (there's tons of design methods, the above is just a sample only), see if you can understand any of it.