I have seven questions related to game making


#1

Rediscovery of Exodus
http://www.gurufocus.com/links/roe/ep1/

I wanted to make a game like Charles Tian’s “Rediscovery of Exodus”, but I have been running into some snags.

  1. How do I make the character die after the character gets zero or negative hit points?

  2. How do I make weapons give stat bonuses? (Like…“3 Slotted Spear” [+5 Str, -10 Agi])

  3. How do I make it so that if you equip another weapon, the weapon bonuses for Weapon 1 will be replaced by Weapon 2’s bonuses? (Like…if I replaced the 3 Slotted Spear with the Small Dagger [+1 Str, +5 Agi], the 3 Slotted Spear’s effect will be gone and will be replaced with the Small Dagger’s effect. So if a char’s base Agi was 30, his Agi would be 20 with the spear, but if he replaced the spear with the dagger, his new Agi would be 35, rather than 25.)

  4. How do I create a stat cap? Also - how would I go about creating an inn? (Replenishes all HP)

  5. I want to create a timed game and have the character age a year every X days, but I am confused as to how I can go about this. Also - how can I make events trigger on Day Y and such?

  6. How do I create enemies with their own stats and hit points and such that will attack my character? If this isn’t possible at this time, I can find a workaround.

  7. On the topic of enemies…how do I rotate them, so that if the character goes to “The Generic Woods”, then he or she can go up against either a Hawk, Fox or a Deer, rather than just have one enemy for one zone? If this is also not possible, then nevermind. This could also apply to different events going on in one zone.

Sorry if my list was long and thank you in advance if you know the answer to any one of these questions.

And now I shall revive…the Multiple Stat Screens Thread!

http://www.choiceofgames.com/forum/discussion/106/multiple-stat-screens/p1 o-+


#2

(Just answering the easiest IMO first.)

  1. Every time you *set health, use an ‘*if health <= 0’ to send the character to their death if their health is too low.

  2. You need two variables: the first will the the actual variable, say ‘health’ and the second would be the cap, which you’ll just name ‘max_health’. To replenish health to maximum, just “*set health max_health”.

  3. It’s possible (I think there are at least one or two games that have a combat system implemented, Gargoyle (http://gargoyle.unimatrix42.com/mygame/) was one of them), however, for the combat to feel like anything more than just ‘spam the correct attack until the thing dies’ will require a ton of work.

  4. If you want to send the PC to any one of a number of random scenes, just use the *rand command, followed by *if commands tying each number to a different scene.
    *rand combat_scene 1 3
    *if combat_scene = 1
    –*gosub combat_with_hawk
    …repeat *if/gosub for each animal…


#3

Let me address 2) and 3) as they are linked.

First off, I’d create a list of all weapons and armour your character can get for reference purposes. It will make it easier to keep track when coding. I’d use excel for this, but pen and paper would be equally as good. You will need at least one variable for every item. I’d name them after the item themselves, or if you have a LOT of items, give them an index number as well. Eg variable names 111_short_sword and 211_leather_armour. Items beginning with a 1xx would be weapons. Beginning with a 2xx armour. 3xx could be special items, etc.
Initially set all of the item variables to false. As the player picks them up, set them to true. (later if a player sells an item or it breaks, again, set it false).

Now you need to decide when the character can change his inventory. Judging by question 5) you want to have a daily changing system. I’d give the player the option to change his inventory then. Or alternatively (or as well?) every time they pick up a new item. It’d look something like this:

*gosub inventory_change

*label inventory_change
You currently have slot_one and slot_two equipped.
*choice
#change slot_one
What would you like to equip?
*choice
*if (111_short_sword) #Equip my short sword
*set slot_one “Short Sword”
*set attack -attack_mod
*set attack_mod +3
*set attack +attack_mod
*if (112_dagger) #Equip my dagger
*set slot_one “Dagger”
*set attack -attack_mod
*set attack +1
*set attack +attack_mod

Here, attack is your final attack score. Attack_mod is the difference made to your attack score from each item. Slot_one and slot_teo are used to determine what items you are holding.

This would involve a lot of code, but once you have the basics it would be easy to add more items. The hard part would be having this available for every scene, hence why it’d be good to have the day changes.

(note: spacing in the code above is likely to be wrong - make sure the spacing is correct!)


#4

Which leaves #5, and since I do something vaguely similar for Vendetta I’ll briefly explain what I do for that as it may give you something to go on in devising your time system.

Vendetta uses “weeks” in the game, being a not-precisely-defined period of time. All scenes in the game tend to fall into a particular “week” (although some may be carried over into subsequent weeks if the conditions for appearing that week were not quite right, and some also appear semi-randomly in any one of several different weeks . . . but that’s another topic entirely!). The whole is covered by a variable I call weekly_count, which increases by 1 each time I decide it’s a new week end. Being governed by a single variable, it’s a simple matter to have things occur only during a particular week, e.g. *if weekly_count = 5, etc.

The important point is that I decide when exactly to increase the weekly_count timer, based on how much / how many scenes have appeared (or may appear) during that week. You would probably have to make the same decision along similar lines, whether your timing is hourly, daily, weekly or whatever.

What you will not be able to easily do is link game time to real time in any way, which is what it sounds like you were actually hoping to achieve. That would be wildly impractical for a Multiple Choice game and probably not worth the effort, even if actually possible. To make your character(s) age, I would suggest simply setting your own timer variable and increase it now and then according to the pace / timescale of your game.


#5

Ah thank you all. I have encountered another problem though. It gives me a script error when I post this - please help!
`
*rand combat_scene 1 7
*if combat_scene = 1
*gosub thug
*if combat_scene = 2
*gosub harlot
*if combat_scene = 3
*gosub gnginit
*if combat_scene = 4
*gosub thief
*if combat_scene = 5
*gosub dealer
*if combat_scene = 6
*gosub sick
*if combat_scene = 7
*gosub beggar

*label sick
You encounter a sickly harlot!
*choice
#Attack!
*if combat >= 29
You swiftly snap the harlot’s neck and put her out of her disease and trauma filled misery. You also loot a chip from her. Shame on you.
*set money +1
*goto_scene start
*if combat >= 19
You have hit the harlot for half damage! The harlot slashes at you for 5 damage.
*set health -5
#Attack!
As the harlot falls to the floor, she lets out a bloodcurdling scream. You loot a chip from her and walk back home.
*set money +1
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 9
You have hit the harlot for quarter damage! The harlot slashes at you for 5 damage.
*set health -5
#Attack!
You have hit the harlot for quarter damage! The harlot slashes at you for 5 damage.
*set health -5
#Attack!
As the harlot falls to the floor, she lets out a bloodcurdling scream. You loot a chip from her and walk back home.
*set money +1
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 3
*label pathetic
The harlot laughs at your feeble attempt. The harlot slashes at you for 5 damage!
*set health -5
*goto pathetic
*if health <= 0
You have died. SO SORRY!
You have died. Sorry champ.
*goto_scene fatal
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start

*label beggar
You encounter a sad looking beggar.
*if money >= 10
You give him 1 chip and walk away.
*goto_scene start
You sadly tell him that you have no chips to spare yourself.
*goto_scene start

*label thug
You encounter a common thug!
*choice
#Attack!
*if combat >= 49
You swiftly snap the thug’s neck and put an end to his crime spree of terror. You also loot 5 chips from him.
*set money +5
*goto_scene start
*if combat >= 39
You have hit the thug for half damage! The thug slashes at you for 5 damage.
*set health -5
#Attack!
The thug groans as he falls to the floor. This sort of thing must be common around here.
*set money +5
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 29
You have hit the thug for quarter damage! The thug slashes at you for 5 damage.
*set health -5
#Attack!
You have hit the thug for quarter damage! The thug slashes at you for 5 damage.
*set health -5
#Attack!
The thug groans as he falls to the floor. This sort of thing must be common around here.
*set money +5
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 19
*label pathetic
The thug spits at your feet. The thug slashes at you for 5 damage!
*set health -5
*goto pathetic
*if health <= 0
You have died. SO SORRY!
You have died. Sorry champ.
*goto_scene fatal
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start

*label harlot
You encounter a sexy harlot!
*choice
#Attack!
*if combat >= 49
You swiftly snap the harlot’s neck and send her into an earlier retirement than she had hoped for. You also loot 5 chips from her. Shame on you.
*set money +5
*goto_scene start
*if combat >= 39
You have hit the harlot for half damage! The harlot slashes at you for 5 damage.
*set health -5
#Attack!
The harlot groans as she falls to the floor. This sort of thing must be common around here.
*set money +5
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 29
You have hit the harlot for quarter damage! The harlot slashes at you for 5 damage.
*set health -5
#Attack!
You have hit the harlot for quarter damage! The harlot slashes at you for 5 damage.
*set health -5
#Attack!
The harlot groans as she falls to the floor. This sort of thing must be common around here.
*set money +5
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 19
*label pathetic
The harlot gives you a patronizing look. The harlot slashes at you for 5 damage!
*set health -5
*goto pathetic
*if health <= 0
You have died. SO SORRY!
You have died. Sorry champ.
*goto_scene fatal
#Run!
“(S)he who runs away, lives to fight another day!”`
*goto_scene start


#6

`*label gnginit
You encounter a young gang initiate!
*choice
#Attack!
*if combat >= 29
You swiftly snap the young boy’s neck and put him out of his violence and poverty filled misery. You also loot a chip from him. Shame on you.
*set money +1
*goto_scene start
*if combat >= 19
You have hit the gang initiate for half damage! The gang initiate slashes at you for 5 damage.
*set health -5
#Attack!
The young boy lets out a final anguished cry and falls to the floor. You loot a chip from him and walk back home.
*set money +1
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 9
You have hit the gang initiate for quarter damage! The gang initiate slashes at you for 5 damage.
*set health -5
#Attack!
You have hit the gang initiate for quarter damage! The gang initiate slashes at you for 5 damage.
*set health -5
#Attack!
The young boy lets out a final anguished cry and falls to the floor. You loot a chip from him and walk back home.
*set money +1
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 3
*label pathetic
The gang initiate insults your mother. The gang initiate slashes at you for 5 damage!
*set health -5
*goto pathetic
*if health <= 0
You have died. SO SORRY!
You have died. Sorry champ.
*goto_scene fatal
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start

*label thief
Miniboss encountered! You encounter a wily thief!
*choice
#Attack!
*if combat >= 69
You swiftly snap the thief’s neck and save the valuables of the rich. You also loot 25 chips from him. Score!
*set money +25
*goto_scene start
*if combat >= 49
You have hit the thief for half damage! The thief slashes at you for 10 damage.
*set health -10
#Attack!
The thief groans as he falls to the floor. This sort of thing must be common around here.
*set money +25
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 29
You have hit the thief for quarter damage! The thief slashes at you for 10 damage.
*set health -10
#Attack!
You have hit the thief for quarter damage! The thief slashes at you for 10 damage.
*set health -10
#Attack!
The thief groans as he falls to the floor. This sort of thing must be common around here.
*set money +25
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
The thief laughs and tells you to go home.
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start

*label dealer
Boss monster! You encounter a drug dealer!
*choice
#Attack!
*if combat >= 89
You swiftly snap the drug dealer’s neck and save the minds of Rosewood’s school children. You also loot 50 chips from him. Score!
*set money +50
*goto_scene start
*if combat >= 69
You have hit the drug dealer for half damage! The drug dealer slashes at you for 25 damage.
*set health -25
#Attack!
The drug dealer swears vengeance upon you and your future children before he passes out.
*set money +50
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if combat >= 59
You have hit the drug dealer for quarter damage! The drug dealer slashes at you for 25 damage.
*set health -25
#Attack!
You have hit the drug dealer for quarter damage! The drug dealer slashes at you for 25 damage.
*set health -25
#Attack!
The drug dealer swears vengeance upon you and your future children before he passes out.
*set money +50
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
*if health <= 0
You have died. SO SORRY!
*goto_scene fatal
The drug dealer tells you to “go away and stop cramping my style”. You follow his advice.
*goto_scene start
#Run!
“(S)he who runs away, lives to fight another day!”
*goto_scene start`


#7

A few changes to the script above (just reread it now - a few obvious errors. That’ll teach me to type on my phone!)

The dashes at the start of each line tell you how many spaces you should have.

*gosub inventory_change

*label inventory_change
You currently have {slot_one} and {slot_two} equipped.
*choice
__#change slot_one
____What would you like to equip?
____*choice
____*if (111_short_sword) #Equip my short sword
______*set slot_one “Short Sword”
______*set attack -attack_mod
______*set attack_mod +3
______*set attack +attack_mod
______Do you want to change anything else?
______*choice
________#Yes
__________*goto inventory_change
________#No
__________*return
____*if (112_dagger) #Equip my dagger
______*set slot_one “Dagger”
______*set attack -attack_mod
______*set attack_mod +1
______*set attack +attack_mod
______Do you want to change anything else?
______*choice
________#Yes
__________*goto inventory_change
________#No
__________*return
____#I’ve changed my mind. I’ll keep my {slot_one} equipped. __#change slot_two ____What would you like to equip? ____\*choice ____\*if (211_leather_armour) #Equip my leather armor. ______\*set slot_two "Leather Armour" ______\*set defence -defence_mod ______\*set defence_mod +2 ______\*set defence +defence_mod ______Do you want to change anything else? ______\*choice ________#Yes __________\*goto inventory_change ________#No __________\*return ____\*if (212_iron_helm) #Equip my iron_helm ______\*set slot_two "Iron Helm" ______\*set defence -defence_mod ______\*set defence_mod +3 ______\*set defence +defence_mod ______Do you want to change anything else? ______\*choice ________#Yes __________\*goto inventory_change ________#No __________\*return ____#I've changed my mind. I'll keep my {slot_two} equipped.

From this, you can edit and expand it as much as you need. As you can see, there’s a lot of text for each item (although copy/paste works wonders). You may also want to display the effects of each item in the choice line. For example, replace:

____*if (212_iron_helm) #Equip my iron_helm

With:

____*if (212_iron_helm) #Equip my iron_helm (+3 Defence)


#8

Okay I changed some of the “lower greaters” to the *if (combat >=19) and (combat <29) format. What else is wrong with my code?


#9

kk I also fixed the *choice error and also I put in *finish and fixed the *label and *goto pathetic command to do this -

*if (combat >=3) and (combat <9) *label pathetic The harlot laughs at your feeble attempt. The harlot slashes at you for 5 damage! *set health -5 *choice #Attack! The harlot laughs at your feeble attempt. The harlot slashes at you for 5 damage! *set health -5 *goto pathetic *finish #Run! "(S)he who runs away, lives to fight another day!" *goto_scene start

Oh and also I fixed the error where I forgot to put *goto_scene fatal and added a few more *if health commands.


#10

Ahh! x.x I cant get this to work.

I’m going to start all over again and stick to three enemies. x.x

Wish me luck guys.


#11

YESSSS! Finally found the code that doesn’t make me crash horribly!
You encounter a sickly harlot! *choice #Attack! *if combat >= 29 You snap the harlot's neck and swiftly put her out of her disease and trauma filled misery. You also loot 1 chip from her body. Shame on you. *set money +1 *goto_scene start *if (combat >=19) and (combat <29) You hit the harlot for half damage! The harlot scratches you for 5 damage! *set health -5 *choice #Attack! As the harlot falls to the floor, she lets out a bloodcurdling scream. You loot a chip from her and walk back home. *set money +1 *goto_scene start #Run! "He who runs away, lives to fight another day!" *goto_scene start *finish *if health <= 0 The harlot raises up her leg and kicks your head in. You have died. *goto_scene fatal *if (combat >=9) and (combat <19) You hit the harlot for quarter damage! The harlot scratches you for 5 damage! *set health -5 *choice #Attack! You hit the harlot for quarter damage! The harlot scratches you for 5 damage! *set health -5 *choice #Attack! You hit the harlot for quarter damage! The harlot scratches you for 5 damage! *set health -5 *choice #Attack! As the harlot falls to the floor, she lets out a bloodcurdling scream. You loot a chip from her and walk back home. *set money +1 *goto_scene start #Run! "He who runs away, lives to fight another day!" *goto_scene start *if health <= 0 The harlot raises up her leg and kicks your head in. You have died. *goto_scene fatal *finish *if health <= 0 The harlot raises up her leg and kicks your head in. You have died. *goto_scene fatal #Run! "He who runs away, lives to fight another day!" *goto_scene start *finish *if health <= 0 The harlot raises up her leg and kicks your head in. You have died. *goto_scene fatal #Run! "He who runs away, lives to fight another day!" *goto_scene start

Thank you guys!


#12

One quick thing (just an FYI) about errors, try to use Internet Explorer for testing as it’s the only thing that displays the error messages correctly all the time.