<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">100</strength>
<endurance type="int">100</endurance>
<statusattributes type="stringdictionary">strength =;endurance =</statusattributes>
</object>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">100</strength>
<endurance type="int">100</endurance>
<statusattributes type="simplestringdictionary">strength =;endurance =</statusattributes>
</object>
// this might ~probably is~ be a bit incorrect, as I've haven't used it this way yet.
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">100</strength>
<endurance type="int">100</endurance>
<statusattributes type="stringdictionary">
<item>
<key>strength</key>
<value></value>
</item>
<item>
<key>endurance</key>
<value></value>
</item>
</statusattributes>
</object>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">100</strength>
<endurance type="int">100</endurance>
<hit_points type="string">0/0</hit_points>
<current_hit_points type="int">999</current_hit_points>
<maximum_hit_points type="int">999</maximum_hit_points>
<statusattributes type="simplestringdictionary">strength = STR: !;endurance = END: !;hit_points =!</statusattributes>
</object>
<turnscript name="status_attributes_turnscript>
player.hit_points = "HP:" + player.current_hit_points + "/" + player.maximum_hit_points
</turnscript>
// OR
[code]<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">100</strength>
<endurance type="int">100</endurance>
<hit_points type="string">0/0</hit_points>
<current_hit_points type="int">999</current_hit_points>
<maximum_hit_points type="int">999</maximum_hit_points>
<statusattributes type="stringdictionary">
<item>
<key>strength</key>
<value>STR: !</value>
</item>
<item>
<key>endurance</key>
<value>END: !</value>
</item>
<item>
<key>hit_points</key>
<value>!</value>
</item>
</statusattributes>
</object>
<turnscript name="status_attributes_turnscript>
player.hit_points = "HP:" + player.current_hit_points + "/" + player.maximum_hit_points
</turnscript>
(your pasted game code)
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>cd102f9d-370a-4bda-b6ea-ca42288f619c</gameid>
<version>1.0</version>
<turns type="int">0</turns>
<statusattributes type="simplestringdictionary">turns =</statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<curhp type="int">250</curhp>
<maxhp type="int">500</maxhp>
<current_hit_points type="int">999</current_hit_points>
<maximum_hit_points type="int">999</maximum_hit_points>
<maxhp type="int">500</maxhp>
<hp type="string">0/0</hp>
<strength type="int">100</strength>
<endurance type="int">100</endurance>
<agility type="int">100</agility>
<hit_points type="string">0/0</hit_points>
<statusattributes type="simplestringdictionary">hp = ;hit_points =!;strength =;endurance = !;agility = Your agility is !</statusattributes>
</object>
</object>
<turnscript name="turns_turnscript">
<enabled />
<script>
player.hp = player.curhp + "/" + player.maxhp
player.hit_points = "HP: " + player.current_hit_points + "/" + player.maximum_hit_points
game.turns = game.turns + 1
</script>
</turnscript>
</asl>
<asl version="540">
<include ref="English.aslx"/>
<include ref="Core.aslx"/>
<game name="Daring Do and the Crystal Caves">
<gameid>648a8422-7e07-4900-b693-2fec17451fd9</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<hits type="int">10</hits>
<strength type="int">1</strength>
<constitution type="int">1</constitution>
<agility type="int">1</agility>
<wits type="int">1</wits>
<intelligence type="int">1</intelligencee>
<personality type="int">1</personality>
</object>
</object>
</asl>
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Daring Do and the Crystal Caves">
<gameid>648a8422-7e07-4900-b693-2fec17451fd9</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<hits type="int">10</hits>
<strength type="int">1</strength>
<constitution type="int">1</constitution>
<agility type="int">1</agility>
<wits type="int">1</wits>
<intelligence type="int">1</intelligence>
<personality type="int">1</personality>
<exp type="int">0</exp>
<statusattributes type="stringdictionary">
<item>
<key>strength</key>
<value>Strength: !</value>
</item>
<item>
<key>constitution</key>
<value>Constitution: !</value>
</item>
<item>
<key>agility</key>
<value>Agility: !</value>
</item>
<item>
<key>wits</key>
<value>Wits: !</value>
</item>
<item>
<key>intelligence</key>
<value>Intelligence: !</value>
</item>
<item>
<key>personality</key>
<value>Personality: !</value>
</item>
<item>
<key>hits</key>
<value>Hit Points: !</value>
</item>
</statusattributes>
</object>
</object>
</asl>
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="MLP Ascendancy">
<gameid>cf52fea4-bb48-43e0-b3d5-d328d519c521</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<start type="script">
startmenu = NewStringList()
list add (startmenu, "New Game")
list add (startmenu, "Load Game")
list add (startmenu, "Background")
ShowMenu ("START MENU", startmenu, false) {
if (result="New Game") {
ClearScreen
msg ("Please tell me your name.")
get input {
player.alias = result
msg ("Okay, your name is "+player.alias +".")
wait {
gendermenu = NewStringList()
list add (gendermenu, "male")
list add (gendermenu, "female")
ShowMenu ("Are you Male or Female", gendermenu, false) {
player.gender = result
msg ("Okay, you are a "+player.gender +".")
wait {
ClearScreen
msg ("Okay, so, your name is "+player.alias +" and you are a human "+player.gender +".")
classmenu = NewStringList()
list add (classmenu, "Mercenary")
list add (classmenu, "Rouge")
list add (classmenu, "Gadgeteer")
ShowMenu ("What class would you like to be?", classmenu, false) {
player.class = result
msg ("Excellent. You are a "+player.class+".")
if (result="Mercenary") {
player.strength = 3
player.stamina = 3
player.agility = 2
player.intellect = 1
player.wits = 1
player.personality = 1
}
}
}
}
}
}
}
}
</start>
</game>
<object name="Choose an option">
<inherit name="editor_object" />
<dark />
<darkroomdescription type="string"></darkroomdescription>
<descprefix type="string"></descprefix>
<objectslistprefix type="string"></objectslistprefix>
<visible type="boolean">false</visible>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<statusattributes type="stringdictionary">
<item>
<key>player.alias</key>
<value>Name: </value>
</item>
<item>
<key>player.gender</key>
<value>Sex: </value>
</item>
<item>
<key>player.class</key>
<value>Class: </value>
</item>
</statusattributes>
</object>
</object>
</asl>
jaynabonne wrote:In the statusattributes dictionary:
1) Remove "player." from the keys. It should just be "alias", not "player.alias".
2) Put "!" where you want the value to be displayed. For example, "Name: !", not just "Name: ".
You will want to initialize the values as well. "player.alias" defaults to "me", and "player.gender" defaults (for some reason) to "you". But you'll see that once the status variables start to show.
(An unrelated thing: it's "rogue", I think. Unless you're able to be a cosmetic or a bit red...)
player.alias = ""
player.gender = ""
jaynabonne wrote:Add this to your start script:player.alias = ""
player.gender = ""
Normally, you can just create attributes on the object to initialize them, but there are certain pre-defined attributes on the player that seem to ignore your overrides, for reasons I haven't researched yet.
Error running script: Error compiling expression '"Okay, so, your name is "+alias +" and you are a human "+gender +"."': Unknown object or variable 'alias'
Rainbow Dash wrote:OKay, so I think I am starting to understand this coding language. Is it Java?
Rainbow Dash wrote:So from my understanding, this line: <constitution type="int">1</constitution>
This line is used to set variable in the programming language. I change the type of variable by changing the "int" to "string" if I want to add to the string library right? And the name at the beginning of that line is the name of said variable, right?
<object name="fire_orc_1">
<inherit name="editor_object" />
<inherit name="fire_type" />
<alias>orc</alias>
<strength type="int">50</strength>
// etc etc etc
</object>
<function name="fight_function">
// blah scripting
</function>
<type name="fire_type">
<fire_damage type="int">100</fire_damage>
<fire_resistance type="int">100</fire_resistance>
</type>
<command name="fight_command">
// blah blah blah
</command>
<verb name="fight_verb">
// blah blah blah
</verb>
enemy_damage = orc.strength - player.endurance + orc.fire_damage
if (enemy_damage >= player.hit_points) {
msg ("The " + enemy.alias + " kills you.")
msg ("GAME OVER")
finish
} else {
// blah blah blah
}
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="StackLibrary.aslx" />
<include ref="wearables.aslx" />
<game name="MLP Ascendancy: Book 1">
<gameid>cf52fea4-bb48-43e0-b3d5-d328d519c521</gameid>
<version>0.1</version>
<firstpublished>2013</firstpublished>
<povstatusattributes type="stringdictionary" />
<defaultwebfont>Oswald</defaultwebfont>
<defaultfontsize type="int">12</defaultfontsize>
<defaultbackground>Black</defaultbackground>
<defaultforeground>OrangeRed</defaultforeground>
<attr name="autodescription_youcansee" type="int">0</attr>
<attr name="autodescription_youcango" type="int">0</attr>
<attr name="autodescription_description" type="int">2</attr>
<autodescription_youarein_newline />
<autodescription_youcango_newline />
<autodescription_youcansee_newline />
<autodescription_description_newline />
<category>RPG</category>
<defaultlinkforeground>Orange</defaultlinkforeground>
<pov type="object">player</pov>
<start type="script"><![CDATA[
// This section governs all aspects of the main menu and the character creation process.
startmenu = NewStringList()
list add (startmenu, "New Game")
list add (startmenu, "Background")
list add (startmenu, "Instructions")
list add (startmenu, "A Note from the Author")
ShowMenu ("START MENU", startmenu, false) {
if (result="New Game") {
ClearScreen
msg ("Please tell me your name.")
get input {
player.alias = result
msg ("Okay, your name is "+player.alias +".")
wait {
gendermenu = NewStringList()
list add (gendermenu, "male")
list add (gendermenu, "female")
ShowMenu ("Are you Male or Female", gendermenu, false) {
player.gender = result
msg ("Okay, you are a "+player.gender +".")
wait {
ClearScreen
msg ("Okay, so, your name is "+player.alias +" and you are a human "+player.gender +".")
classmenu = NewStringList()
list add (classmenu, "Mercenary")
list add (classmenu, "Rogue")
list add (classmenu, "Gadgeteer")
ShowMenu ("What class would you like to be?", classmenu, false) {
player.class = result
msg ("Excellent. You are a "+player.class+".")
if (result="Mercenary") {
player.strength = 3
player.stamina = 3
player.agility = 2
player.intellect = 1
player.wits = 2
player.personality = 1
player.exp = 0
player.credits = 100
player.level = 1
}
else if (result="Rogue") {
player.strength = 1
player.stamina = 2
player.agility = 3
player.intellect = 1
player.wits = 3
player.personality = 2
player.exp = 0
player.credits = 100
player.level = 1
}
else if (result="Gadgeteer") {
player.strength = 1
player.stamina = 1
player.agility = 2
player.intellect = 3
player.wits = 2
player.personality = 3
player.exp = 0
player.credits = 100
player.level = 1
}
wait {
ClearScreen
msg ("It's dark. There is nothing but the cold blackness and your own heartbeat. There are no walls, floor or even a ceiling, you are simply floating in the void.<br/><br/>\"Hello?\" You speak out, almost afraid of your own voice. \"Is anyone there?\"<br/><br/>The darkness is suddenly broken by a blinding white light infront of you. You raise your hands to shield your eyes, trying to peer into the light through the cracks in your fingers. You think that you can make out a figure in the light, but you cant make out the form.<br/><br/>\"Hello? Whos there!?\" You yell in the direction of the figure, not sure of where you are or what is happening. You hear a soft, female voice reach out from the light to caress your ears.<br/><br/>\"Dont be afraid, its all about to change.\"<br/><br/>You are about to respond, when you are suddenly falling through the void. You fall for what seems like mere moments before you hit something solid.")
wait {
ClearScreen
MoveObject (player, Bed Room)
player.modifiedstrength = ""
player.modifiedstamina = ""
player.modifiedagility = ""
player.ac = 0
player.maxhits = player.hits + player.stamina
player.hits = 5
player.hp = player.hits + player.stamina
player.relationrd = ""
player.relationrarity = ""
player.relationaj = ""
player.relationpp = ""
player.relationfs = ""
player.relationts = ""
}
}
}
}
}
}
}
}
else if (result="Background") {
ClearScreen
msg ("Humans had such potential and for a time, it looked as though they might actually live up to that potential. For a time, they spread peacefully, settling a few worlds outside of their own. But, they still didn’t learn how to look after those worlds. Slowly, their world became worse and worse. It grew hotter and hotter and it became apparent that it was being subject to a runaway greenhouse effect. The air was becoming more and more noxious, but humans still cling on there today. During the time of this expansion the humans encountered a nearby race called the Xetic. The Xetic were, in all fairness, an aggressive and hostile race. They declared war on the Humans and pushed them straight back to their homeworld. Bombing the planet from orbit, the Xetic hoped to eradicate the humans without any further fight. They didn’t account for the fact that the humans can dig in and fight like animals when they are cornered.<br/><br/> The humans took massive losses. Billions of them died and nearly a half dozen worlds were burned. But, the humans got the upper hand. During the course of the war they developed various technologies that allowed them to become…powerful. Powerful enough, even outnumbered to start pushing the Xetic back. They were just enough to give them an advantage for the short space of time they needed. Launching a single mission, they launched an attack on a nearby Xetic system and using a newly developed weapon, they sent its sun nova. Billions of Xetic died in a heartbeat and the galaxy at large suddenly paid attention.<br/><br/> Before this point, the Xetic and Humans weren’t aware of other races in the galaxy, but they began to intervene. They didn’t want to get involved militarily, so they started trying to find a diplomatic solutions. But, the humans were angry and desperate. Every week, another Xetic star was destroyed. And all the while the galaxy dithered, trying to find a political solution, the humans got closer and closer, until one day, the Xetic star vanished, taking the last of the Xetic with it. For a few months, the galaxy was at a loss, stunned by the total extermination of a sentient species. The humans were of course, completely unapologetic. Having been close to being wiped out themselves, they claimed self-defence. They also cited the hypocrisy of the other races.<br/><br/> Words got heated between the humans and the rest of the galaxy, nothing like this had happened before. The galaxy took its time, studying the behaviour of the humans, what they were doing to themselves, what they were doing to their world. And finally, a consensus was reached. It was decided that the humans…were incapable and too immature to look after themselves. The galaxy ordered the humans to surrender and submit to governance by the rest of the galaxy. The humans of course, refused.<br/><br/> Standing against the Xetic was one thing, standing against over a dozen races united, was something else entirely. It happened quickly, the plan had been thought over for a long time. And it was deceptively simple. Cut off the head and the rest will die. In one surprise attack, the galaxy eliminated the human military command and its governments worldwide. A few short months later, the human race collapsed and surrendered. Humans, from that point on were rendered to second class citizens, barely above a slave class. They were forbidden to govern themselves and to form any sort of military or police force again.<br/><br/> The humans were permitted to keep their world and system for their own uses, but forbidden to expand further into the galaxy. The human race is subject to galactic law, but not the whole law. They are, by vote in the council, entitled to far less. Their rights have all but been stripped. They are looked on as savages and barbarians and are treated as such. Some races even keep them as slaves, though this is frowned on by the other races, but the crimes of the human race seem to temper attempts to prevent the slavery of humans.<br/><br/> But this is where you find yourself now, in the last city on Earth, New York. The only place that survived the war, populated by a race that is oppressed by the rest of the galaxy ‘for their own good’. <br/>")
wait {
ClearScreen
}
}
}
]]></start>
</game>
<object name="Choose an option">
<inherit name="editor_object" />
<dark />
<darkroomdescription type="string"></darkroomdescription>
<descprefix type="string"></descprefix>
<objectslistprefix type="string"></objectslistprefix>
<visible type="boolean">false</visible>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="defaultplayer" />
<status>-</status>
<statusattributes type="stringdictionary">
<item>
<key>alias</key>
<value>Name: !</value>
</item>
<item>
<key>gender</key>
<value>Gender: !</value>
</item>
<item>
<key>class</key>
<value>Class: !</value>
</item>
<item>
<key>level</key>
<value>Level: !</value>
</item>
<item>
<key>hp</key>
<value>Hit Points: !</value>
</item>
<item>
<key>strength</key>
<value>Strength: !</value>
</item>
<item>
<key>stamina</key>
<value>Stamina: !</value>
</item>
<item>
<key>agility</key>
<value>Agility: !</value>
</item>
<item>
<key>intellect</key>
<value>Intellect: !</value>
</item>
<item>
<key>wits</key>
<value>Wits: !</value>
</item>
<item>
<key>personality</key>
<value>Personality: !</value>
</item>
<item>
<key>exp</key>
<value>Exp: !</value>
</item>
<item>
<key>credits</key>
<value>Credits: !</value>
</item>
</statusattributes>
</object>
</object>
<object name="Bed Room">
<inherit name="editor_room" />
</object>
<object name="Health Pack">
<inherit name="editor_object" />
<inherit name="childstack_object" />
<take />
<look>This is a standard issue Health Pack, common all over the slums. It restores 5 hit points.</look>
<stackparent type="object">Health Pack</stackparent>
<use type="script"><![CDATA[
if (player.hp <> player.maxhits and < player.maxhits) {
player.hp = player.hp + 5
if (player.hp > player.maxhits) {
player.hp = player.maxhits
}
}
else if (player.hp > or = player.maxhits) {
AddToInventory (Health Pack)
msg ("You do not need healing.")
}
]]></use>
</object>
<object name="Bolt Pistol">
<inherit name="editor_object" />
<inherit name="wearable" />
<attr name="wear_layer" type="int">1</attr>
<wear_slots type="stringlist">
<value>Weapon</value>
</wear_slots>
<look>This is a crappy gunpoweder pistol from just before humanswere oppressed. Its better than a knife, but not as good as some of the energy weapons available. Its adds +3 to your strength in combat.</look>
<onafterwear type="script">
player.modifiedstrength = player.strength + 3
</onafterwear>
<onafterremove type="script">
player.modifiedstrength = player.strength - 3
</onafterremove>
</object>
<object name="Flak Vest">
<inherit name="editor_object" />
<inherit name="wearable" />
<attr name="wear_layer" type="int">1</attr>
<wear_slots type="stringlist">
<value>Armour</value>
</wear_slots>
<onafterwear type="script">
player.ac = +1
</onafterwear>
<onafterremove type="script">
player.ac = -1
</onafterremove>
<look>While a little more advanced than the Flak Vest of the 20 and 21st centuries, this still provideds little protection. But its better than nothing. +1 AC.</look>
</object>
</asl>
rainbow dash wrote:I have a problem though, why arent the attributes showing up in the status box when they are changed?
HegemonKhan wrote:I have a habit to edit my posts a bit, so refresh and read over my old posts, as I've probably added or corrected some stuff in them. I have already edited some of my previous posts, which you probably hadn't thus read that new or changed stuff within them.
--------------------"rainbow dash"
I have a problem though, why arent the attributes showing up in the status box when they are changed?
I think in the GUI~Editor, there's a choice for your attributes to create a "changed script" for it, and I think you can use this to do what you want. I didn't know about exactly what this "changed script" in the GUI~Editor's Attribute (Tab)'s "window".
Otherwise, the way I'm familiar with, is in using the turnscript, to update your status attribute's values. I think there's also a code~script line (it is normally used internally by the quest engine) that you can add into some scripting, to do this as well too.
I've shown you already how to do this (via the turnscript method) in my previous posts.
---------------
(one sec)
jaynabonne wrote:Add this to your start script:player.alias = ""
player.gender = ""
Normally, you can just create attributes on the object to initialize them, but there are certain pre-defined attributes on the player that seem to ignore your overrides, for reasons I haven't researched yet.
rainbow dash wrote:Figured that one out. I was using the player. in the keys and it didnt like that.
player.relationrd = player.agility + player.strength
player.relationrarity = player.wits + player.personality
player.relationaj = player.strength + player.stamina
player.relationpp = player.personality + player.stamina
player.relationfs = player.intellect + player.personality
player.relationts = player.intellext + player.wits
Rainbow Dash wrote:So, is there a way to increase the size of the status box so that the stats arent scrolling?
Also, lets say I want one of my options in my menu to loop back to the menu...how do I do that?
For example, I have a background option. I want the players to be able to read the background and when they are done, go back to the menu without having to restart the game. Is there a way to get that done?
Object
-> Game (the Game Object)
->-> Verbs
->-> Commands
-> "room" (your default Room Object)
->-> "player" (your default Player Object)
Functions
Timers
Advanced
-> Libraries
->-> Core.aslx (the game engine coding)
->-> English.aslx (makes the coding and quest itself for~of~in the "english" font~language, for us english speakers)
-> Types (Object Types; ie create a GROUP of~for having~holding many attributes)
-> Java Script
V
V
V
Filter (at the very bottom; ie the bottom left corner of the GUI~Editor screen)
<turnscript name="global_events_turnscript">
leveling_function // every turn, quest will do the leveling function, which starts by "checking" if you've current got enough experience to increase in level
game.turns = game.turns + 1
</turnscript>
<function name="leveling_function"><![CDATA[
if (player.experience >= player.level * 100 + 100) {
player.experience = player.experience - (player.level * 100 + 100)
player.level = player.level + 1
leveling_function // this starts the "leveling function" all over again; ie the loop code line
}
]]></function>
<turnscript name="global_events_turnscript">
leveling_function // every turn, quest will do the leveling function, which starts by "checking" if you've current got enough experience to increase in level
game.turns = game.turns + 1
</turnscript>
<function name="leveling_function"><![CDATA[
if (player.experience >= player.level * 100 + 100) {
player.experience = player.experience - (player.level * 100 + 100)
level_plus_one_adder_function
on ready {
leveling_function // this starts the "leveling function" all over again; ie the loop code line
}
}
]]></function>
<function name="level_plus_one_adder_function"><![CDATA[
if (player.alias = HK and player.level < 99) { // HK grins toothily~evilly, muwahaha!
player.level = player.level + 1 // err, this is going to be a lot of loopings, +98 of them, lol. HK grins toothily~evilly, muwahaha!
level_plus_one_adder_function // HK grins toothily~evilly, muwahaha!
} else if (player.alias = "Rainbow Dash") {
player.level = player.level + 1
}
]]></function>
Rainbow Dash wrote:Why wont these work?player.relationrd = player.agility + player.strength
player.relationrarity = player.wits + player.personality
player.relationaj = player.strength + player.stamina
player.relationpp = player.personality + player.stamina
player.relationfs = player.intellect + player.personality
player.relationts = player.intellext + player.wits
Okay, just read your post, do I need to have these in an object in order for them to work?
HegemonKhan wrote:"Rainbow Dash"
Why wont these work?
player.relationrd = player.agility + player.strength
player.relationrarity = player.wits + player.personality
player.relationaj = player.strength + player.stamina
player.relationpp = player.personality + player.stamina
player.relationfs = player.intellect + player.personality
player.relationts = player.intellext + player.wits
Okay, just read your post, do I need to have these in an object in order for them to work?
chuckles (when I made my combat code, I used abrevs too, no one knew what they meant, but me), so if you want help, try to get in the habbit of writing out things... so there's no mistake at what you mean, lol
I used to do this:
player.hp // not mysterious but you get the idea
player.pd // very mysterious, what is "pd" ???
now I do this, lol:
player.hit_points
player.physical_damage
so everyone actually knows that I mean "hit points", lol.
Also, I've learned that I myself forget what I mean, and just in general with coding, you need to have lots of notes for yourself too, as it's hard to remember what you're doing and~or what~how your code blocks work, lol.
-----------------
anyways, back on-topic, lol:
you need to actually create (add) these attributes (on~for your Player Object: "player"), as right now they don't actually exist, nor do you have assigned what is their Type of Attribute (which also can only be done via the "player" Player Object in the GUI~Editor, or the "player" Player Object Code Block via In-Code: <object name="player">(blah coding~attributes)</object>)
Rainbow Dash wrote:Okay, its making more sense to me now. Let me show you what I have got so far. Im working on the basic system right now for combat, inventory and leveling. If you see anything that you have questions about or think wont work, let me know.
HegemonKhan wrote:"Rainbow Dash"
Okay, its making more sense to me now. Let me show you what I have got so far. Im working on the basic system right now for combat, inventory and leveling. If you see anything that you have questions about or think wont work, let me know.
if you don't mind sharing your code, I'd love to see yours on these RPG aspects, lol. I'm also trying to build up coding of the RPG aspects, though it's slow for me, as I'm still a noob with coding... slowly learning it... lol.
I've got a combat code done (it's turn-based, and all credit goes to Pertex' and his Combat Library, as I used his code structure)
I've just posted my own leveling code for you in my previous post(s), hehe.
Though, I'd love to see your inventory system once you've got that done, I've made a very "poor-man's-coding" of one: a root container full of many child subdivision container objects and coding to put the stuff into the right container object ~ though it's only done for "spells", lol. If, you're interested, let me know.
Also, Sora and his~her Stackable Library, does just that, puts multiple same type of objects "together", and then removes them as well too.
Sora's Stackable Library: viewtopic.php?f=18&t=3515
and here's some other useful links:
The libraries: viewforum.php?f=18
The Wiki's pages:
http://quest5.net/wiki/Main_Page
http://quest5.net/wiki/Tutorial
http://quest5.net/wiki/How_to
and the "Quest Coding Bible" wiki pages:
http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
http://quest5.net/w/index.php?title=Cat ... h#mw-pages (page 2, range: S-Z)
enjoy
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="StackLibrary.aslx" />
<include ref="wearables.aslx" />
<include ref="combat_lib.aslx" />
<game name="Ascendancy: MLP">
<gameid>104eec08-3128-4e94-9323-9266bda65982</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">0</strength>
<agility type="int">0</agility>
<stamina type="int">0</stamina>
<intellect type="int">0</intellect>
<wits type="int">0</wits>
<personality type="int">0</personality>
<hits type="int">0</hits>
<attr name="modified_strength" type="int">0</attr>
<attr name="modified_stamina" type="int">0</attr>
<attr name="modified_agility" type="int">0</attr>
<attr name="amour_class" type="int">0</attr>
<status>-</status>
<attr name="max_hits" type="script">
max_hits = hits + stamina
</attr>
<attr name="current_hits" type="script">
current_hits = hits + stamina
</attr>
<attr name="rainbow_dash_relation" type="script">
raibow_dash_relation = strength + agility
</attr>
<attr name="rarity_relation" type="script">
rarity_relation = personality + intellect
</attr>
<attr name="pinkie_pie_relation" type="script">
pinkie_pie_relation = personality + stamina
</attr>
<attr name="apple_jack_relation" type="script">
apple_jack_relation = strength + stamina
</attr>
<attr name="fluttershy_relation" type="script">
fluttershy_relation = personality + strength
</attr>
<attr name="twilight_sparkle_relation" type="script">
twilight_sparkle_relation = intellect + wits
</attr>
</object>
</object>
<function name="start_menu">
</function>
</asl>
Rainbow Dash wrote:Nope, that confused the hell out of me. Let me see if I can figure it out. In the fuction that I create, do I use the scripts to make my menu system?
<object name="King_Stupid">
<alias>The King</alias>
<chat type="script">
game.conversation_menu_list_1 = NewStringList ()
list add (conversation_menu_list_1, "princess")
list add (conversation_menu_list_1, "legendary_dragon_slayer_sword")
list add (conversation_menu_list_1, "evil_dragon_king")
show menu ("What do you want to know about?", game.conversation_menu_list_1, false) {
your_selection = result
switch (your_selection) {
case ("princess") {
msg ("She needs to get married, rescue her, and she's all yours and along with my kingdom and wealth!")
}
case ("legendary_dragon_slayer_sword") {
msg ("You need this to kill the dragon, dummy!")
}
case ("evil_dragon_king") {
msg ("He has stolen my daughter, kill it, and save your princess!")
}
}
}
</chat>
<displayverbs type="simplestringlist">Chat</displayverbs>
</obejct>
<object name="King_Stupid">
<alias>The King</alias>
<chat type="script">
show menu ("What do you want to know about?", split ("princess;legendary_dragon_slayer_sword;evil_dragon_king",";"), false) {
your_selection = result
switch (your_selection) {
case ("princess") {
msg ("She needs to get married, rescue her, and she's all yours and along with my kingdom and wealth!")
}
case ("legendary_dragon_slayer_sword") {
msg ("You need this to kill the dragon, dummy!")
}
case ("evil_dragon_king") {
msg ("He has stolen my daughter, kill it, and save your princess!")
}
}
</chat>
<displayverbs type="simplestringlist">Chat</displayverbs>
</obejct>
Rainbow Dash wrote:Thank you for your continued help. I keep fiddling, restarting and applying what I have learned, then restarting again. I will share what I have when I have it. At the moment, I have gone back and redone the way my player object is organized. In the last iteration, it was all a mess, so here I have neatened it all up and initialized all the attributes and attribute scripts. Here it is so far.<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="StackLibrary.aslx" />
<include ref="wearables.aslx" />
<include ref="combat_lib.aslx" />
<game name="Ascendancy: MLP">
<gameid>104eec08-3128-4e94-9323-9266bda65982</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">0</strength>
<agility type="int">0</agility>
<stamina type="int">0</stamina>
<intellect type="int">0</intellect>
<wits type="int">0</wits>
<personality type="int">0</personality>
<hits type="int">0</hits>
<attr name="modified_strength" type="int">0</attr>
<attr name="modified_stamina" type="int">0</attr>
<attr name="modified_agility" type="int">0</attr>
<attr name="amour_class" type="int">0</attr>
<status>-</status>
<attr name="max_hits" type="script">
max_hits = hits + stamina
</attr>
<attr name="current_hits" type="script">
current_hits = hits + stamina
</attr>
<attr name="rainbow_dash_relation" type="script">
raibow_dash_relation = strength + agility
</attr>
<attr name="rarity_relation" type="script">
rarity_relation = personality + intellect
</attr>
<attr name="pinkie_pie_relation" type="script">
pinkie_pie_relation = personality + stamina
</attr>
<attr name="apple_jack_relation" type="script">
apple_jack_relation = strength + stamina
</attr>
<attr name="fluttershy_relation" type="script">
fluttershy_relation = personality + strength
</attr>
<attr name="twilight_sparkle_relation" type="script">
twilight_sparkle_relation = intellect + wits
</attr>
</object>
</object>
<function name="start_menu">
</function>
</asl>
As you can see...much neater already. I am using stackables, wearables and the combat libraries.
HegemonKhan wrote:"Rainbow Dash"
Thank you for your continued help. I keep fiddling, restarting and applying what I have learned, then restarting again. I will share what I have when I have it. At the moment, I have gone back and redone the way my player object is organized. In the last iteration, it was all a mess, so here I have neatened it all up and initialized all the attributes and attribute scripts. Here it is so far.
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="StackLibrary.aslx" />
<include ref="wearables.aslx" />
<include ref="combat_lib.aslx" />
<game name="Ascendancy: MLP">
<gameid>104eec08-3128-4e94-9323-9266bda65982</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">0</strength>
<agility type="int">0</agility>
<stamina type="int">0</stamina>
<intellect type="int">0</intellect>
<wits type="int">0</wits>
<personality type="int">0</personality>
<hits type="int">0</hits>
<attr name="modified_strength" type="int">0</attr>
<attr name="modified_stamina" type="int">0</attr>
<attr name="modified_agility" type="int">0</attr>
<attr name="amour_class" type="int">0</attr>
<status>-</status>
<attr name="max_hits" type="script">
max_hits = hits + stamina
</attr>
<attr name="current_hits" type="script">
current_hits = hits + stamina
</attr>
<attr name="rainbow_dash_relation" type="script">
raibow_dash_relation = strength + agility
</attr>
<attr name="rarity_relation" type="script">
rarity_relation = personality + intellect
</attr>
<attr name="pinkie_pie_relation" type="script">
pinkie_pie_relation = personality + stamina
</attr>
<attr name="apple_jack_relation" type="script">
apple_jack_relation = strength + stamina
</attr>
<attr name="fluttershy_relation" type="script">
fluttershy_relation = personality + strength
</attr>
<attr name="twilight_sparkle_relation" type="script">
twilight_sparkle_relation = intellect + wits
</attr>
</object>
</object>
<function name="start_menu">
</function>
</asl>
As you can see...much neater already. I am using stackables, wearables and the combat libraries.
looks good to me (though I haven't worked with the <attr></attr> stuff yet, so I don't know if you got that set up correctly, but I'm sure you can figure it out, if it's not working as you want it to for you). Do you get any errors when (1) trying to start~load up the game (into the Editor~Gui), and (2) while actually playing your game?
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="StackLibrary.aslx" />
<include ref="wearables.aslx" />
<include ref="combat_lib.aslx" />
<game name="Ascendancy: MLP">
<gameid>104eec08-3128-4e94-9323-9266bda65982</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<start type="script">
start_menu
</start>
</game>
<object name="Please choose an option">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<dark />
<darkroomdescription type="string"></darkroomdescription>
<descprefix type="string"></descprefix>
<objectslistprefix type="string"></objectslistprefix>
<description type="script">
</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">0</strength>
<agility type="int">0</agility>
<stamina type="int">0</stamina>
<intellect type="int">0</intellect>
<wits type="int">0</wits>
<personality type="int">0</personality>
<level type="int">1</level>
<class type="string"></class>
<experience type="int">0</experience>
<hits type="int">5</hits>
<attr name="modified_strength" type="int">0</attr>
<attr name="modified_stamina" type="int">0</attr>
<attr name="modified_agility" type="int">0</attr>
<attr name="amour_class" type="int">0</attr>
<status>-</status>
<statusattributes type="stringdictionary">
<item>
<key>alias</key>
<value>Name: !</value>
</item>
<item>
<key>class</key>
<value>Class: !</value>
</item>
<item>
<key>level</key>
<value>Level: !</value>
</item>
<item>
<key>experience</key>
<value>EXP: !</value>
</item>
</statusattributes>
<attr name="max_hits" type="script">
max_hits = hits + stamina
</attr>
<attr name="current_hits" type="script">
current_hits = hits + stamina
</attr>
<attr name="rainbow_dash_relation" type="script">
raibow_dash_relation = strength + agility
</attr>
<attr name="rarity_relation" type="script">
rarity_relation = personality + intellect
</attr>
<attr name="pinkie_pie_relation" type="script">
pinkie_pie_relation = personality + stamina
</attr>
<attr name="apple_jack_relation" type="script">
apple_jack_relation = strength + stamina
</attr>
<attr name="fluttershy_relation" type="script">
fluttershy_relation = personality + strength
</attr>
<attr name="twilight_sparkle_relation" type="script">
twilight_sparkle_relation = intellect + wits
</attr>
</object>
</object>
<function name="start_menu">
start_options = NewStringList()
list add (start_options, "New Game")
list add (start_options, "Instructions")
list add (start_options, "Background")
list add (start_options, "Note from the Author")
ShowMenu ("START MENU", start_options, false) {
}
</function>
</asl>
Error running script: Error compiling expression 'Replace(format, "!", value)': FunctionCallElement: Could find not function 'Replace(String, String, LazyLoadScript)'
Please choose an option.
Error running script: Error compiling expression 'Replace(format, "!", value)': FunctionCallElement: Could find not function 'Replace(String, String, LazyLoadScript)'
Error running script: Error compiling expression 'Replace(format, "!", value)': FunctionCallElement: Could find not function 'Replace(String, String, LazyLoadScript)'
HegemonKhan wrote:I got to go to bed, so I haven't yet loaded up your game to test fixes, but just from looking at it, here's some guesses at it:
All of those Status Attributes, need you to create (add) those actual Attributes!
player -> Attributes (Tab) -> Attributes -> Add ->
Name: alias
Type: string
Value: (whatever you want it to be, what you want to be called or it to be called, lol)
Name: class
Type: stringlist (is better as you can then use a menu to choose from a selection that you create for it, but you can do~use a string too)
Value (for example): warrior, cleric, mage, thief
level... experience...
etc... (all those new attributes in your Status Attributes, must actually be made, you need to make~add those attributes as attributes to your "player" !!!)
--------------
player (or whatever Object) -> Attributes (Tab) -> Attributes -> Add ->
*THIS CREATES THE ATTRIBUTES, IF YOU DON'T CREATE ATTRIBUTES, YOU DON'T HAVE ANY ATTRIBUTES!*
player (this however is ONLY for~of a Player Object or the Game Object) -> Attributes (Tab) -> Status Attributes -> Add ->
this is merely what you THEN want to do (in terms of how they get displayed and~or changed) with the attributes that you already created (or will create to get rid of the errors! ~ hopefully, lol) created !!!
-------------
if you still got the errors, I'll look at it tomarrow after class... if someone else hasn't helped you yet.
<attr name="current_hits" type="script">
current_hits = hits + stamina
</attr>
<attr name="current_hits" type="script">
hits = hits + stamina
</attr>
jaynabonne wrote:You have this:<attr name="current_hits" type="script">
current_hits = hits + stamina
</attr>
You have a *script* called current_hits, and within that, it's manipulating both current_hits and hits. If you actually do run "current_hits", it will replace itself with an integer!
It looks like you changed variable names mid-stream. I think you need to change the above to:<attr name="current_hits" type="script">
hits = hits + stamina
</attr>
and then add "hits" to your status. If you do want the status attribute to be current_hits, then you need to change more things than that to make it all consistent.
jaynabonne wrote:Assuming you want something like:playermaxhits = playerbasehits + playerstamina
as an initialization value, you'll need to put such expression into a script, perhaps the start script for the game. You can't initialize an attribute to an expression.
<game name="Ascendancy: MLP">
<gameid>675d0491-f241-46ec-bc70-d9875255241a</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<playmaxhits type="script">
playermaxhits = playerbasehits + playerstamina
</playmaxhits>
</game>
<game name="Ascendancy: MLP">
<gameid>675d0491-f241-46ec-bc70-d9875255241a</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<start type="script">
playermaxhits = playerbasehits + playerstamina
</start>
</game>
<playermaxhits type="int">0</playermaxhits>
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Ascendancy: MLP">
<gameid>675d0491-f241-46ec-bc70-d9875255241a</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<start type="script">
start_menu
playermaxhits = playerbasehits + playerstamina
playercurrenthits = playerbasehits + playerstamina
playerattack = playeragility
playerdefense = playeragility
</start>
Error running script: Error compiling expression 'playerbasehits + playerstamina': Unknown object or variable 'playerbasehits'
jaynabonne wrote:Sorry. My mistake. The variables belong to the game object so:game.playermaxhits = game.playerbasehits + game.playerstamina
Since you're in a script running on the game object, you could also use "this" instead of "game", as "this" will refer to the game object.
Error running script: Error compiling expression 'game.playerbasehits + game.playerstamina': ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Object'
<game name="Ascendancy: MLP">
<gameid>675d0491-f241-46ec-bc70-d9875255241a</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<playerbasehits type="int">5</playerbasehits>
<playerstamina type="int">3</playerstamina>
<playeragility type="int">6</playeragility>
<start type="script">
start_menu
game.playermaxhits = game.playerbasehits + game.playerstamina
game.playercurrenthits = game.playerbasehits + game.playerstamina
game.playerattack = game.playeragility
game.playerdefense = game.playeragility
</start>
</game>
jaynabonne wrote:I guess I had assumed that you would have those attributes defined already, either as attribute definitions or as script lines. I was never really sure where they came from... Here's an example:<game name="Ascendancy: MLP">
<gameid>675d0491-f241-46ec-bc70-d9875255241a</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<playerbasehits type="int">5</playerbasehits>
<playerstamina type="int">3</playerstamina>
<playeragility type="int">6</playeragility>
<start type="script">
start_menu
game.playermaxhits = game.playerbasehits + game.playerstamina
game.playercurrenthits = game.playerbasehits + game.playerstamina
game.playerattack = game.playeragility
game.playerdefense = game.playeragility
</start>
</game>
I just typed that in here. I hope it's all right.
Edit: You *could* have attributes on the player called "maxhits", "stamina", etc. and then use "player.maxhits", "player.stamina", etc instead of game.playermaxhits, game.playerstamina, etc. Just a design thought.
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Ascendancy: MLP">
<gameid>675d0491-f241-46ec-bc70-d9875255241a</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<playerclass type="string"></playerclass>
<playerlevel type="int">1</playerlevel>
<playerexp type="int">0</playerexp>
<playerstrength type="int">0</playerstrength>
<playeragility type="int">0</playeragility>
<playerstamina type="int">0</playerstamina>
<playerintellect type="int">0</playerintellect>
<playerwits type="int">0</playerwits>
<playerpersonality type="int">0</playerpersonality>
<playerbasehits type="int">0</playerbasehits>
<start type="script">
start_menu
game.playermaxhits = game.playerbasehits + game.playerstamina
game.playercurrenthits = game.playerbasehits + game.playerstamina
game.playerattack = game.playeragility
game.playerdefense = game.playeragility
</start>
Code:
<object name="your_object_name">
<name_of_your_attribute type="your_choosen_attribute_type">your_Attribute_Value</name_of_your_attribute>
</object>
for example:
<object name="orc">
<strength type="int">50</strength>
</object>
Default Game Object and its Attributes from a new game:
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="HK">
<inherit name="editor_player" />
<strength type="int">100</strength>
</object>
HegemonKhan wrote:Attributes are permanent "stats", which can thus be used anywhere:
the correct "CREATION OF ATTRIBUTE" format is this:
GUI~Editor: "blah" (Object) -> Attribute (Tab) -> Attributes -> Add -> (make your Attribute: Name, Type, and Value)Code:
<object name="your_object_name">
<name_of_your_attribute type="your_choosen_attribute_type">your_Attribute_Value</name_of_your_attribute>
</object>
for example:
<object name="orc">
<strength type="int">50</strength>
</object>
the correct SCRIPTING (USING OF YOUR ATTRIBUTE) format is this, in Code:
Object.Attribute // only for String, Stringlist, and Boolean=True Attribute Types
~OR~
Object.Attribute=Value
so, for example:
player.warrior // a Stringlist choice for your "class" Attribute, (I think) it's the same as: player.class="warrior")
~OR~
player.strength=100
------------------------------------------
........V
Object . Attribute = Value (no spaces though, just doing this to make the dot~period more visable hopefully, lol)
........^
you need that period~dot! it is the "attach'er", the code equivalent of: "blah" (Object) -> Attributes (Tab) -> Attributes -> Add
and for an (example) expression, the correct format is this:
Object.Attribute = Object.Attribute (and must be same Attribute Type) + Object.Attribute (and must be same Attribute Type)
SOO......
I think you want this (if I'm correct, Jayna was misunderstanding you, not realizing that the "player" was your Attributes' Objects, it seems like Jayna thought your "playermaxhits" was simply the name of your Attribute, not realizing you were just forgetting~not knowing~ to put in the dot~period to separate, ie attach, the Object and Attribute words~labels~"names"):
player.maxhits = player.basehits + player.stamina
-----------------------------
Also...
for "Object.Attribute", the Object and Attribute can be whatever you want:
Object: Player Objects (examples: "player", "HK", "Rainbow Dash"), Normal~Object Objects (examples: "orc", "book", "global_event_data_object"), Room Objects (examples: "room", "wasteland"), and the Game Object
Attribute: no need to explain what you already know, lol.
HOWEVER...
for what is displayed on the right side (STATUS ATTRIBUTES) while playing the game, it's ONLY for these Objects:
the Player Objects and the Game Object
------------------------------------------------
so, by the way:
the Game Object:
GUI~Editor: Game (Object) -> 6 Tabs: Setup ~ Script ~ Room Descriptions ~ Player ~ Display ~ Attributes
Code, for Creation:
<game name="blah">
</game>Default Game Object and its Attributes from a new game:
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
Code, for SCRIPTING (USING):
game.Attribute
~OR~
game.Attribute=Value
--------------------------------------------------
The Player Object:
1. the default is: "player"
2. you can have many player objects, and can switch between (your control of) them.
3. GUI~Editor: Game -> Player (Tab) -> Player Object box -> choose or leave blank
~AND~
"blah" (Object) -> Setup (Tab) -> Object Type box: OBJECT
"blah" (Object) -> Options (Tab) -> Player box -> CAN BE PLAYER
4. http://quest5.net/wiki/Changing_the_player_object
Code, for CREATION:
example only:<object name="HK">
<inherit name="editor_player" />
<strength type="int">100</strength>
</object>
Code, for SCRIPTING:
example only:
HK.strength=100
----------------------------
last thing:
game.pov
game.pov represents whoever is your CURRENTLY CONTROLLED Player Object
so let's say we've got 3 Player Objects:
Default: "player"
Created #1: "HK"
Created #2: "RD" // Rainbow Dash
player.strength=0
HK.strength=100
RD.strength=50
"game.pov.strength" is the same as "player.strength"
"game.pov.strength" is the same as "HK.strength"
"game.pov.strength" is the same as "RD.strength"
IF you only have a single Player Object in your game
however, if you do have multiple Player Objects in your game:
then you got to be careful... with using "game.pov", because...
it'll be applied to whoever is your currently controlled Player Object
so, for an example:
"player" is an archer who gets: +2 dexterity at level ups
"HK" is a warrior who gets: +2 strength at level ups
"RD" is a mage who gets: +2 intelligence at level ups
if you were to use:
game.pov.dex = game.pov.dex + 2
then, if your currently controlled player object is "HK" when you receive a level up, would get the +2 dex
so, if you got specific scripts for specific Player Objects, then use (for examples): player.Attribute OR HK.Attribute OR RD.Attribute
however, some scripts you intentionally want+make them to be applied to all of your Player Objects, such as this example:
receiving experience from a monster after killing it:
game.pov.experience = game.pov.experience + name_of_monster_object.experience // this will correctly give that experience amount to the Player Object that killed the monster, whoever that Player Object is (in the moment that you kill the monster)
as you don't want to do script it three times, lol:
player.experience = player.experience + name_of_monster_object.experience
HK.experience = HK.experience + name_of_monster_object.experience
RD.pov.experience = RD.pov.experience + name_of_monster_object.experience
Rainbow Dash wrote:"HegemonKhan"
Stuff was said here.
OKay, I understand, I got most of that. It doesnt help me to understand how to create a variable the way I need it to be.
I need to have a set of statistics as follows:
Strength - "Set by the players choice of class"
Agility - "Set by class"
Stamina - "Set by class"
Intellect - "Set by class"
Wits - "Set by class"
Personality - "Set by class"
Base Hits - "Set by class"
All of these need to be tied to the player object.
THEN I need a set of variables that can be freely altered in a number of ways, such as:
Attack - This is the sum of the characters Strength and Agility stat. So, I need to be able to add the strength and agility together to get this stat...but it also needs to be on the player object. Do you understand now what I need?
Sorry if I sound like I am getting short. This program is making a pigs-ear out of something that should be really bloody simple.
<function name="battle_sequence_function" parameters="self,enemy"><![CDATA[
if (enemy.dead=false or self.escaped=false) {
you_go_first=false
if (GetInt (self,"speed") > GetInt (enemy,"speed") {
you_go_first=true
} else if (GetInt (self,"speed") = GetInt (enemy,"speed") and RandomChance (50)=true) {
you_go_first=true
}
if (you_go_first=true) {
msg ("You get to go first for this round")
self_battle_turn_function (self,enemy)
on ready {
if (not enemy.dead=true or not self.escaped=true){
enemy_battle_turn_function (self,enemy)
}
}
} else {
msg (enemy.alias + " gets to go first for this round.")
enemy_battle_turn_function (self,enemy)
on ready {
if (not enemy.dead=true or not self.escaped=true){
msg ("It is now your turn.")
self_battle_turn_function (self,enemy)
}
}
}
on ready {
msg ("The round has ended.")
battle_sequence_function (self,enemy)
}
} else {
msg ("The battle is over.")
}
]]></function>
<game name="blah">
// blah coding
<you_go_first type="boolean">false</you_go_first>
// blah coding
</game>
<function name="battle_sequence_function" parameters="self,enemy"><![CDATA[
if (enemy.dead=false or self.escaped=false) {
game.you_go_first=false
if (GetInt (self,"speed") > GetInt (enemy,"speed") {
game.you_go_first=true
} else if (GetInt (self,"speed") = GetInt (enemy,"speed") and RandomChance (50)=true) {
game.you_go_first=true
}
if (game.you_go_first=true) {
msg ("You get to go first for this round")
self_battle_turn_function (self,enemy)
on ready {
if (not enemy.dead=true or not self.escaped=true){
enemy_battle_turn_function (self,enemy)
}
}
} else {
msg (enemy.alias + " gets to go first for this round.")
enemy_battle_turn_function (self,enemy)
on ready {
if (not enemy.dead=true or not self.escaped=true){
msg ("It is now your turn.")
self_battle_turn_function (self,enemy)
}
}
}
on ready {
msg ("The round has ended.")
battle_sequence_function (self,enemy)
}
} else {
msg ("The battle is over.")
}
]]></function>
Rainbow Dash wrote:OKay, I understand, I got most of that. It doesnt help me to understand how to create a variable the way I need it to be.
I need to have a set of statistics as follows:
Strength - "Set by the players choice of class"
Agility - "Set by class"
Stamina - "Set by class"
Intellect - "Set by class"
Wits - "Set by class"
Personality - "Set by class"
Base Hits - "Set by class"
All of these need to be tied to the player object.
THEN I need a set of variables that can be freely altered in a number of ways, such as:
Attack - This is the sum of the characters Strength and Agility stat. So, I need to be able to add the strength and agility together to get this stat...but it also needs to be on the player object. Do you understand now what I need?
Sorry if I sound like I am getting short. This program is making a pigs-ear out of something that should be really bloody simple.
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>cd102f9d-370a-4bda-b6ea-ca42288f619c</gameid>
<version>1.0</version>
<start type="script">
msg ("What is your name?")
get input {
msg (" - " + result)
player.alias_x = result
show menu ("What is your gender?", split ("male;female" , ";"), false) {
player.gender_x = result
show menu ("What is your race?", split ("human;elf;dwarf" , ";"), false) {
player.race = result
show menu ("What is your class?", split ("warrior;cleric;mage;thief" , ";"), false) {
player.class = result
msg (player.alias_x + " is a " + " " + player.gender_x + " " + player.race + " " + player.class + ".")
}
}
}
}
</start>
<turns type="int">0</turns>
<statusattributes type="simplestringdictionary">turns = </statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_player" />
<inherit name="editor_object" />
<alias_x type="string"></alias_x>
<gender_x type="string"></gender_x>
<strength type="int">10</strength>
<endurance type="int">20</endurance>
<intelligence type="int">30</intelligence>
<spirituality type="int">40</spirituality>
<agility type="int">50</agility>
<statusattributes type="simplestringdictionary">alias_x = Name: !;gender_x = Gender: !;strength = ;endurance = ;intelligence = ;spirituality = ;agility = ;level = ;experience = ;physical_damage = PD: !;magical_damage = MD: !</statusattributes>
<level type="int">0</level>
<experience type="int">0</experience>
<physical_damage type="int">0</physical_damage>
<magical_damage type="int">0</magical_damage>
</object>
<object name="potion100">
<inherit name="editor_object" />
<alias>potexp100</alias>
<take />
<displayverbs type="simplestringlist">Look at; Take; Drink</displayverbs>
<inventoryverbs type="simplestringlist">Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
player.experience = player.experience + 100
</drink>
</object>
<object name="potion300">
<inherit name="editor_object" />
<alias>potexp300</alias>
<take />
<displayverbs type="simplestringlist">Look at; Take; Drink</displayverbs>
<inventoryverbs type="simplestringlist">Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 300 experience.")
player.experience = player.experience + 300
</drink>
</object>
</object>
<turnscript name="global_events_turnscript">
<enabled />
<script>
leveling_function
player.physical_damage = player.strength + player.endurance
player.magical_damage = player.intelligence + player.spirituality
game.turns = game.turns + 1
</script>
</turnscript>
<function name="leveling_function"><![CDATA[
if (player.experience >= player.level * 100 + 100) {
player.experience = player.experience - (player.level * 100 + 100)
player.level = player.level + 1
switch (player.gender_x) {
case ("male") {
player.strength = player.strength + 1
}
case ("female") {
player.agility = player.agility + 1
}
}
switch (player.race) {
case ("dwarf") {
player.strength = player.strength + 2
player.endurance = player.endurance + 2
}
case ("elf") {
player.intelligence = player.intelligence + 2
player.spirituality = player.spirituality + 2
}
case ("human") {
player.strength = player.strength + 1
player.endurance = player.endurance + 1
player.agility = player.agility + 1
player.spirituality = player.spirituality + 1
}
}
switch (player.class) {
case ("warrior") {
player.strength = player.strength + 2
}
case ("cleric") {
player.intelligence = player.intelligence + 1
player.agility = player.agility + 1
}
case ("mage") {
player.intelligence = player.intelligence + 2
}
case ("thief") {
player.strength = player.strength + 1
player.agility = player.agility + 1
}
}
leveling_function
}
]]></function>
</asl>
<function name="self_battle_turn_function" parameters="self,enemy"><![CDATA[
msg (self.alias + " has " + self.current_health_points + " HP left.")
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
wait {
show menu ("What is your battle choice?", split ("Attack;Defend;Cast;Item;Run", ";"), false) {
switch (result) {
case ("Attack") {
self_attack_failed = false
if (RandomChance (GetInt (enemy,"agility") - GetInt (self,"speed")) = true) {
msg (enemy.alias + "evaded your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"dexterity") - GetInt (self,"agility")) = true) {
msg (enemy.alias + "parried your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"agility") - GetInt (self,"dexterity")) = true) {
msg (enemy.alias + "blocked your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (self,"dexterity") - GetInt (enemy,"speed")) = false) {
msg ("Your attack missed " + enemy.alias +"!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"armor_class") - GetInt (self,"attack_rating")) = true) {
msg ("Your attack failed to penetrate " + enemy.alias +"!")
self_attack_failed = true
self.defending = false
} else if (self_attack_failed = false) {
if (self.defending = true and enemy.defending = true) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * 2 * GetInt (self,"physical_damage") / 2 + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
self.defending = false
} else if (self.defending = true and enemy.defending = false) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * 2 * GetInt (self,"physical_damage") + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
self.defending = false
} else if (self.defending = false and enemy.defending = true) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * GetInt (self,"physical_damage") / 2 + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
} else if (self.defending = false and enemy.defending = false) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * GetInt (self,"physical_damage") + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
}
}
}
case ("Defend") {
msg ("You defend yourself against " + enemy.alias)
self.defending = true
}
case ("Cast") {
self.defending = false
}
case ("Item") {
self.defending = false
}
case ("Run") {
self.defending = false
self.escaping = true
}
}
if (GetInt (enemy,"current_health_points") > 0) {
if ( RandomChance (GetInt (self,"speed") - GetInt (enemy,"speed"))= true) {
msg ("You get an extra battle turn!")
self_battle_turn (self,enemy)
} else {
msg ("Your battle turn is over.")
}
} else if (GetInt (enemy,"current_health_points") <= 0) {
msg (enemy.alias + " is dead.")
msg ("You have won the battle!")
self.defending = false
self.escaping = false
enemy.defending = false
enemy.dead = true
}
}
}
]]></function>
<object name="global_flags_ie_booleans_data_object">
<inherit name="editor_object" />
<parent>null</parent>
<talked_to_king type="boolean">false</talked_to_king>
<found_dragon_slayer_sword type="boolean">false</found_dragon_slayer_sword>
<killed_the_dragon_king type="boolean">false</killed_the_dragon_king>
</object>
<turnscript name="global_turnscript">
<enabled />
if (dragon_slayer_sword.parent = player) {
global_flags_ie_booleans_data_object.found_dragon_slayer_sword=true
}
if (global_flags_ie_booleans_data_object.talked_to_king=true and global_flags_ie_booleans_data_object.found_dragon_slayer_sword=true and global_flags_ie_booleans_data_object.killed_the_dragon_king=true) {
msg ("You just won the game!")
finish
}
</turnscript>
<object name="castle">
<inherit name="editor_room" />
<object name="king">
<inherit name="editor_object" />
<talk type="script">
msg ("You talked to the king, and he told you about the dragon king and the dragon slayer sword to kill it")
global_flags_ie_booleans_data_object.talked_to_king=true
</talk>
<displayverbs type="simplestringlist">Talk</displayverbs>
</object>
</object>
<object name="haunted_woods">
<inherit name="editor_room" />
<object name="dragon_slayer_sword">
<inherit name="editor_object" />
<take />
<displayverbs type="simplestringlist">Take</displayverbs>
</object>
</object>
<object name="sky_mountain">
<inherit name="editor_room" />
<object name="dragon_king">
<inherit name="editor_object" />
<fight type="script">
if (dragon_slayer_sword.parent = player) {
msg ("You stab the dragon king with your dragon slayer sword, killing him!)
global_flags_ie_booleans_data_object.killed_the_dragon_king=true
} else {
msg ("You stab with your wooden sword, it shatters against his adamantium scales, and the dragon king then incinerates you.")
msg ("GAME OVER, you LOST!")
finish
}
</fight>
<displayverbs type="simplestringlist">Fight</displayverbs>
</object>
</object>
Rainbow Dash wrote:
OKay, I understand, I got most of that. It doesnt help me to understand how to create a variable the way I need it to be.
I need to have a set of statistics as follows:
Strength - "Set by the players choice of class"
Agility - "Set by class"
Stamina - "Set by class"
Intellect - "Set by class"
Wits - "Set by class"
Personality - "Set by class"
Base Hits - "Set by class"
All of these need to be tied to the player object.
THEN I need a set of variables that can be freely altered in a number of ways, such as:
Attack - This is the sum of the characters Strength and Agility stat. So, I need to be able to add the strength and agility together to get this stat...but it also needs to be on the player object. Do you understand now what I need?
Sorry if I sound like I am getting short. This program is making a pigs-ear out of something that should be really bloody simple.
<object name="HumanClass">
<strength type="int">4</strength>
<agility type="int">3</agility>
<stamina type="int">5</stamina>
... etc...
</object>
<object name="ElfClass">
<strength type="int">3</strength>
<agility type="int">5</agility>
<stamina type="int">3</stamina>
... etc...
</object>
<function name="SetClass" parameters="class">
player.strength = class.strength
player.agility = class.agility
player.stamina = class.stamina
... etc ...
player.attack = player.strength + player.agility
</function>
<function name="SetClass" parameters="class">
player.class = class
player.attack = player.class.strength + player.class.agility
</function>
SetClass(HumanClass)
<function name="SetClass" parameters="classname">
switch (classname) {
case ("human") {
player.strength = 4
player.agility = 3
player.stamina = 5
.. etc...
}
case ("elf") {
player.strength = 3
player.agility = 5
player.stamina = 3
.. etc...
}
}
// And then finally set the derived attributes...
player.attack = player.strength + player.agility
</function>
SetClass("human")
jaynabonne wrote:(Continuing as the online response editor gets reealllly slow with longer posts.)
An alternative to creating separate class objects is to just hard-code it all in script. Here is an alternative "SetClass" function that takes a class name instead of a class object:<function name="SetClass" parameters="classname">
switch (classname) {
case ("human") {
player.strength = 4
player.agility = 3
player.stamina = 5
.. etc...
}
case ("elf") {
player.strength = 3
player.agility = 5
player.stamina = 3
.. etc...
}
}
// And then finally set the derived attributes...
player.attack = player.strength + player.agility
</function>
And then you'd just do, for example:SetClass("human")
Rainbow Dash wrote:Okay, now lets say that the player levels up and his stats change, I would have to write a script into the level up function that reruns the arithmetic to get the correct attributes again, correct?
<changedagility type="script">
player.attack = player.strength + player.agility
</changedagility>
<changedstrength type="script">
player.attack = player.strength + player.agility
</changedstrength>
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Ascendancy">
<gameid>a132737e-d5bc-418d-a234-36d3bebd6441</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<class>none</class>
<level type="int">1</level>
<exp type="int">0</exp>
<strength type="int">0</strength>
<agility type="int">0</agility>
<stamina type="int">0</stamina>
<intellect type="int">0</intellect>
<wits type="int">0</wits>
<personality type="int">0</personality>
<basehits type="int">5</basehits>
<startinghits type="int">0</startinghits>
<maxhits type="int">0</maxhits>
<currenthits type="int">0</currenthits>
</object>
</object>
<function name="hit_points">
player.maxhits = player.stamina + player.basehits
</function>
<function name="current_hits">
player.currenthits = player.maxhits
</function>
<function name="starting_hits">
player.startinghits = player.basehits + player.stamina
</function>
</asl>
jaynabonne wrote:That should work. You'll just need to call the scripts at the right time (or stick them in "changed" scripts so they happen automatically).
Now, just a personal note on the code...
I *personally* would not have an attribute called "currenthits" and a script called "current_hits" unless you either have already worked it out as a personal style or just enjoy inviting Fate and Insanity into later parts of your project, when your eyes are blurring and you can't remember which one is the attribute and which one is not, especially when assigning a value to "current_hits" would change your script attribute into an int. A typical programming convention is to use verbs for functions that do things. So a name might be "updatecurrenthits" or "setcurrenthits" or "update_currenthits" or however you want to verbalize it and spell it. Obviously, it's up to you what you want to name things, so I'll stop here. It's just something that struck me.
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Ascendancy">
<gameid>a132737e-d5bc-418d-a234-36d3bebd6441</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<class>none</class>
<level type="int">1</level>
<exp type="int">0</exp>
<strength type="int">0</strength>
<agility type="int">0</agility>
<stamina type="int">0</stamina>
<intellect type="int">0</intellect>
<wits type="int">0</wits>
<personality type="int">0</personality>
<basehits type="int">5</basehits>
<startinghits type="int">0</startinghits>
<maxhits type="int">0</maxhits>
<currenthits type="int">0</currenthits>
</object>
</object>
<function name="updatehit_points">
player.maxhits = player.stamina + player.basehits
</function>
<function name="updatecurrent_health">
player.currenthits = player.maxhits
</function>
<function name="starting_hits">
player.startinghits = player.basehits + player.stamina
</function>
<function name="SetClass" parameters="class">
switch (class) {
case (Mercenary) {
player.strength = 3
player.agility = 2
player.stamina = 3
player.intellect = 1
player.wits = 2
player.personality = 1
starting_hits
}
}
</function>
</asl>
<changedstamina type="script">
// Stamina changes both maxhits and startinghits
updatehit_points
starting_hits
</changedstamina>
<changedbasehits type="script">
// basehits changes both maxhits and startinghits
updatehit_points
starting_hits
</changedbasehits>
<changedmaxhits type="script">
// maxhits changes currenthits
updatecurrent_health
</changedmaxhits>
jaynabonne wrote:Aack, sorry. I didn't explain what a "changed script" was.
Whenever an attribute is set on an object, Quest will look to see if there is a script attribute on that object with the name "changed" plus the attribute name. If it exists, then the script is run. So, for example, if you have an attribute called "hits", it will look for a script called "changedhits" to run whenever "hits" is changed by a new value being assigned to it.
That's why I picked the name for the scripts I showed you before - if you use those names (e.g. changedagility and changedstrength), then they will be run for you by Quest so you don't have to.
To create a script attribute on the player (are you using the desktop version? If not, then I'm afraid you can't, so ignore this in that case), click the player object and then the Attributes tab. You can then create an attribute with the right name and set it to type "script" and then make it do what you like.
For example, for the functions you have below, you can trigger them with these player attributes:<changedstamina type="script">
// Stamina changes both maxhits and startinghits
updatehit_points
starting_hits
</changedstamina>
<changedbasehits type="script">
// basehits changes both maxhits and startinghits
updatehit_points
starting_hits
</changedbasehits>
<changedmaxhits type="script">
// maxhits changes currenthits
updatecurrent_health
</changedmaxhits>
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Ascendancy">
<gameid>a132737e-d5bc-418d-a234-36d3bebd6441</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<changedbasehits type="script">
update_hitpoints
</changedbasehits>
<changedstamina type="script">
update_hitpoints
</changedstamina>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<class>none</class>
<level type="int">1</level>
<exp type="int">0</exp>
<strength type="int">0</strength>
<agility type="int">0</agility>
<stamina type="int">0</stamina>
<intellect type="int">0</intellect>
<wits type="int">0</wits>
<personality type="int">0</personality>
<basehits type="int">5</basehits>
<startinghits type="int">0</startinghits>
<maxhits type="int">0</maxhits>
<currenthits type="int">0</currenthits>
<attack type="int">0</attack>
<defense type="int">0</defense>
</object>
</object>
<function name="update_playerattack">
player.attack = player.agility
</function>
<function name="update_playerdefense">
player.defense = player.agility
</function>
<function name="update_hitpoints">
player.maxhits = player.stamina + player.basehits
</function>
<function name="update_currenthealth">
player.currenthits = player.maxhits
</function>
<function name="starting_hits">
player.startinghits = player.basehits + player.stamina
</function>
<function name="SetClass" parameters="class">
switch (class) {
case (Mercenary) {
player.strength = 3
player.agility = 2
player.stamina = 3
player.intellect = 1
player.wits = 2
player.personality = 1
starting_hits
updatecurrent_health
}
case (Rogue) {
player.strength = 2
player.stamina = 2
player.agility = 2
player.intellect = 1
player.wits = 3
player.personality = 2
starting_hits
update_currenthealth
}
case (Gadgeteer) {
player.strength = 1
player.stamina = 2
player.agility = 1
player.intellect = 3
player.wits = 2
player.personality = 2
starting_hits
update_currenthealth
}
}
</function>
</asl>
HegemonKhan wrote:Your code looks good, everything is correct as far as I can see, Jayna can look at his part of the code, if you got it set up right.
<!--Saved by Quest 5.4.4840.17608-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>cd102f9d-370a-4bda-b6ea-ca42288f619c</gameid>
<version>1.0</version>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">
<item>
<key>turns</key>
<value></value>
</item>
</statusattributes>
<start type="script">
msg ("What is your name?")
get input {
msg (" - " + result)
player.alias_x = result
show menu ("What is your gender?", split ("male;female" , ";"), false) {
player.gender_x = result
show menu ("What is your race?", split ("human;elf;dwarf" , ";"), false) {
player.race = result
show menu ("What is your class?", split ("warrior;cleric;mage;thief" , ";"), false) {
player.class = result
msg (player.alias_x + " is a " + " " + player.gender_x + " " + player.race + " " + player.class + ".")
}
}
}
}
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_player" />
<inherit name="editor_object" />
<attr name="alias_x" type="string"></attr>
<attr name="gender_x" type="string"></attr>
<strength type="int">10</strength>
<endurance type="int">20</endurance>
<intelligence type="int">30</intelligence>
<spirituality type="int">40</spirituality>
<agility type="int">50</agility>
<statusattributes type="stringdictionary">
<item>
<key>alias_x</key>
<value>Name: !</value>
</item>
<item>
<key>gender_x</key>
<value>Gender: !</value>
</item>
<item>
<key>strength</key>
<value></value>
</item>
<item>
<key>endurance</key>
<value></value>
</item>
<item>
<key>intelligence</key>
<value></value>
</item>
<item>
<key>spirituality</key>
<value></value>
</item>
<item>
<key>agility</key>
<value></value>
</item>
<item>
<key>level</key>
<value></value>
</item>
<item>
<key>experience</key>
<value></value>
</item>
<item>
<key>physical_damage</key>
<value>PD: !</value>
</item>
<item>
<key>magical_damage</key>
<value>MD: !</value>
</item>
<item>
<key>total</key>
<value>total: !</value>
</item>
</statusattributes>
<level type="int">0</level>
<experience type="int">0</experience>
<attr name="physical_damage" type="int">0</attr>
<attr name="magical_damage" type="int">0</attr>
<total type="int">0</total>
<changedstrength type="script">
player.total = player.strength + player.endurance
</changedstrength>
<changedendurance type="script">
player.total = player.strength + player.endurance
</changedendurance>
</object>
<object name="potion100">
<inherit name="editor_object" />
<alias>potexp100</alias>
<take />
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
<value>Drink</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Use</value>
<value>Drop</value>
<value>Drink</value>
</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
player.experience = player.experience + 100
</drink>
</object>
<object name="potion300">
<inherit name="editor_object" />
<alias>potexp300</alias>
<take />
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
<value>Drink</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Use</value>
<value>Drop</value>
<value>Drink</value>
</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 300 experience.")
player.experience = player.experience + 300
</drink>
</object>
<object name="bonus_strength">
<inherit name="editor_object" />
<alias>potstr</alias>
<take />
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
<value>Drink</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Use</value>
<value>Drop</value>
<value>Drink</value>
</inventoryverbs>
<drink type="script">
msg ("You drink the str potion, receiving +10 strength.")
player.strength = player.strength + 10
</drink>
</object>
<object name="bonus_endurance">
<inherit name="editor_object" />
<alias>potend</alias>
<take />
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
<value>Drink</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Use</value>
<value>Drop</value>
<value>Drink</value>
</inventoryverbs>
<drink type="script">
msg ("You drink the end potion, receiving +5 endurance.")
player.endurance = player.endurance + 5
</drink>
</object>
</object>
<turnscript name="global_events_turnscript">
<enabled />
<script>
leveling_function
player.physical_damage = player.strength + player.endurance
player.magical_damage = player.intelligence + player.spirituality
game.turns = game.turns + 1
</script>
</turnscript>
<function name="leveling_function"><![CDATA[
if (player.experience >= player.level * 100 + 100) {
player.experience = player.experience - (player.level * 100 + 100)
player.level = player.level + 1
switch (player.gender_x) {
case ("male") {
player.strength = player.strength + 1
}
case ("female") {
player.agility = player.agility + 1
}
}
switch (player.race) {
case ("dwarf") {
player.strength = player.strength + 2
player.endurance = player.endurance + 2
}
case ("elf") {
player.intelligence = player.intelligence + 2
player.spirituality = player.spirituality + 2
}
case ("human") {
player.strength = player.strength + 1
player.endurance = player.endurance + 1
player.agility = player.agility + 1
player.spirituality = player.spirituality + 1
}
}
switch (player.class) {
case ("warrior") {
player.strength = player.strength + 2
}
case ("cleric") {
player.intelligence = player.intelligence + 1
player.agility = player.agility + 1
}
case ("mage") {
player.intelligence = player.intelligence + 2
}
case ("thief") {
player.strength = player.strength + 1
player.agility = player.agility + 1
}
}
leveling_function
}
]]></function>
</asl>