Request for advice on certain parimeters
starmoxas
07 Oct 2012, 22:38Hello, I downloaded Quest 5 in order to create a text adventure game with the minimum of fuss. Because I am completely worthless at coding I believed and correctly that this program would be more simple and what I wanted than all the other programs. I am writing a game *cough cough* and would like your advice on certain concepts I do not think I can grasp easily.
1. I have replaced the regular health stat with a modified value called Stamina, and have an additional value called Mana for magic. Now in the course of the game, the values will drop up and down. However I wish to set a maximum value for these two statuses because I don't wish to cheapen the value of healing in the game. Here is the example of the code I used to set these values in the first place
2.Next I have set a menu based system for selecting the player character's race and class. However if during certain events in the game where I mention these two choices in a description and event or open up a different story path depending on these choices. How do I place this information in descriptions and how do I set flags that require a certain class, race, etc? This is the example of how I set the classes
3. In the event that I give certain classes abilities, how do I set them? I had the idea that the skills are only active when a flag is set off by selecting a particular class. But what do you suggest the procedure I should go about using?
4.Last for now I'm using a particular game system that requires the selection of a random value, adding it to a particular status and comparing whether it is smaller or larger to a target value. The problem is while I have a working system for this, it requires me to use a script to set the random value each and every time. Is there anyway I can streamline this by setting a attribute somewhere that selects the random number and all I have to do is place that attribute into the script? This is the working system that I developed
Also one last thing, why does one have to put player. or game. in front of an attribute when using it in a script? I wasted a lot of time figuring that out. Thank you for your assistance
1. I have replaced the regular health stat with a modified value called Stamina, and have an additional value called Mana for magic. Now in the course of the game, the values will drop up and down. However I wish to set a maximum value for these two statuses because I don't wish to cheapen the value of healing in the game. Here is the example of the code I used to set these values in the first place
<Stamina type="int">0</Stamina>
<Mana type="int">0</Mana>
player.Stamina = player.Warrior+6
player.Mana = player.Mage * 2
So how would I set a maximum value for these two, and if there are events in the game that can change these values how I do I code for this circumstance?2.Next I have set a menu based system for selecting the player character's race and class. However if during certain events in the game where I mention these two choices in a description and event or open up a different story path depending on these choices. How do I place this information in descriptions and how do I set flags that require a certain class, race, etc? This is the example of how I set the classes
<Class type="list">Paladin; Barbarian; Sorcerer; Bard; Wizard; Ranger; Thief; Monk</Class>
show menu ("\"Now choose your class\"", game.Class, false) {
if (result ="Barbarian") {
msg ("\"You are a Barbarian\"")
player.Warrior = player.Warrior+5
player.Rogue = player.Rogue+2
}
else if (result ="Paladin") {
msg ("\"You are a Paladin\"")
player.Warrior = player.Warrior+4
player.Mage = player.Mage+3
}
else if (result ="Thief") {
msg ("\"You are a Thief\"")
player.Rogue = player.Rogue+3
player.Mage = player.Mage+2
player.Warrior = player.Warrior+2
}
else if (result ="Ranger") {
msg ("\"You are a Ranger\"")
player.Warrior = player.Warrior+3
player.Rogue = player.Rogue+3
player.Mage = player.Mage+1
}
else if (result ="Sorcerer") {
msg ("\"You are a Sorcerer\"")
player.Mage = player.Mage+5
player.Rogue = player.Rogue+1
player.Warrior = player.Warrior+1
}
else if (result ="Wizard") {
msg ("\"You are a Wizard\"")
player.Mage = player.Mage+6
player.Rogue = player.Rogue+1
}
else if (result ="Bard") {
msg ("\"You are such a spoony Bard\"")
player.Mage = player.Mage+3
player.Rogue = player.Rogue+2
player.Warrior = player.Warrior+2
}
else if (result ="Monk") {
msg ("\"Really? Well if you don't mind that Monks suck\"")
player.Warrior = player.Warrior+3
player.Rogue = player.Rogue+2
player.Mage = player.Mage+2
3. In the event that I give certain classes abilities, how do I set them? I had the idea that the skills are only active when a flag is set off by selecting a particular class. But what do you suggest the procedure I should go about using?
4.Last for now I'm using a particular game system that requires the selection of a random value, adding it to a particular status and comparing whether it is smaller or larger to a target value. The problem is while I have a working system for this, it requires me to use a script to set the random value each and every time. Is there anyway I can streamline this by setting a attribute somewhere that selects the random number and all I have to do is place that attribute into the script? This is the working system that I developed
<look type="script"><
jaynabonne
21 Oct 2012, 22:59The link is actually: www.textadventures.co.uk/review/790
The line of code you asked about isn't what you showed. The line in the file is:
You have single quotes internally. If you change it to what you have in the original question (with double quotes), you'll get a better result.
(Note: For any future uploads, it will be easier if you attach the aslx file here instead of publishing and uploading it. If we have to go into the quest file, the source is not what you are looking at, which can make it a bit harder to work through.)
The line of code you asked about isn't what you showed. The line in the file is:
msg ("You healed ' +game.roll+ ' stamina.")
You have single quotes internally. If you change it to what you have in the original question (with double quotes), you'll get a better result.
msg ("You healed " +game.roll+ " stamina.")
(Note: For any future uploads, it will be easier if you attach the aslx file here instead of publishing and uploading it. If we have to go into the quest file, the source is not what you are looking at, which can make it a bit harder to work through.)
starmoxas
21 Oct 2012, 23:39Oh well in truth I switched to single quotes because double quotes were not working. I'll try again and see though. Remind me it is " then space and the +'s have to stick to the variable in question then another space and the "
So the end result being " +game.roll+ " instead of " + game.roll + "?
So the end result being " +game.roll+ " instead of " + game.roll + "?

jaynabonne
22 Oct 2012, 09:23Actually, outside the quotes, spaces don't matter. So it could be
"+game.roll+"
or
" +game.roll+ "
or
" + game.roll+"
or any variant of that. Spaces inside quotes affect your output, as they are printed literally. If the double quotes still don't work, let us know. And attach your game file here.
"+game.roll+"
or
" +game.roll+ "
or
" + game.roll+"
or any variant of that. Spaces inside quotes affect your output, as they are printed literally. If the double quotes still don't work, let us know. And attach your game file here.
