Help

Zach
Hi. I am new to all of this... I need help with my text adventure game. I am working via web browser. I don't know what to do beyond the basics. Please help...

Avantar
I have never used the online version before but I am sure if you have a specific question, there are people here willing to help as best they can.
Your question is very broad.

Zach
Well, I am trying to get a pre-game menu for players to choose gender and race... plus I need help with health, bits (money) scripts, etc. All I know how to do is rooms, exits, and objects.

HegemonKhan
here's some links:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/guides/
http://docs.textadventures.co.uk/quest/ ... ation.html (this is the main link you want to look at)
http://docs.textadventures.co.uk/quest/ ... _menu.html
http://docs.textadventures.co.uk/quest/ ... _case.html
http://docs.textadventures.co.uk/quest/ ... tiple.html
http://docs.textadventures.co.uk/quest/scripts/set.html

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/types/
http://docs.textadventures.co.uk/quest/scripts/
http://docs.textadventures.co.uk/quest/functions/

-----------

the two most powerful scripts, which especially when used together, enables you to do 90% of everything that you want to do:

1. the 'if' script:

in the GUI~Editor: run as script -> add a script -> scripts -> if -> [EXPRESSION]: for full custom coding ability, or choose whatever [XXX]

2. the 'set' (Attribute or Variable) script:

http://docs.textadventures.co.uk/quest/scripts/set.html

(this is how you make stats~attributes in a game and how to change~adjust them)

in the GUI~Editor, for Scripting: run as script -> add a script -> variables -> set a variable or attribute -> (set it up, see a good bit below: the 'via scripting' section)

or via Objects:

'player' Object -> Attributes (Tab) -> Attributes -> Add -> (see below)

(Object Name: player)
Attribute Name: strength
Attribute Type: int (integer)
Attribute Value: 0

'player' Object -> Attributes (Tab) -> Attributes -> Add -> (see below)

(Object Name: player)
Attribute Name: endurance
Attribute Type: int (integer)
Attribute Value: 0

dexterity, agility, speed, luck, piety, intelligence, spirituality, mentality, perception, deception, personality, charisma, leadership, hp, mp, level, exp, cash, etc etc etc

--------------

via Scripting:

Object_name.Attribute_name = Value_or_Expression

examples of Integer Attributes:
player.strength = 100
player.strength = player.strength + 5
player.strength = player.strength - 5
player.strength = player.strength * 5
player.strength = player.strength / 5
player.strength = player.strength + player.dexterity
orc.hp = orc.hp - player.weapon_damage - player.weapon_damage * (player.strength / 100) + orc.armor_class * (orc.endurance / 100)

examples of Boolean~Flag Attributes:
orc.dead = false
player.flying = false
player.poisoned = false
player.flying = true
player.sleeping = true
player.sleeping = false

examples of String Attributes:
player.alias = "HK"
player.status_effect = "confused"
player.status_effect = "poisoned"
player.race = "human"
player.gender_string = "male"
player.class = "warrior"

examples of Object Attributes:
player.right_hand = wooden_sword
player.right_hand = wooden_shield
player.head = metal_helmet
player.chest = dragon_mail
player.feet = lava_walking_boots

etc Attribute Types: lists, doubles, dictionaries, etc

-------

some quick examples:

a (ending) part of character creation:

if (player.race = "human") {
player.strength = 5
player.intelligence = 5
} else if (player.race = "dwarf") {
player.strength = 10
player.intelligence = 2
} else if (player.race = "elf") {
player.strength = 2
player.intelligence = 10
}


Buying a wooden sword costing 100:

player.cash = player.cash - wooden_sword.price
shop_keeper.cash = shop_keeper.cash + wooden_sword.price
wooden_sword.parent = player


Selling a wooden sword for 50 (price:100/2):

player.cash = player.cash + wooden_sword.price / 2
shop_keeper.cash = shop_keeper.cash - wooden_sword.price / 2
wooden_sword.parent = shop_room


looting a dead monster of its 'cash' integer attribute:

if (orc.dead = true) {
player.cash = player.cash + orc.cash
orc.cash = 0
} else if (orc.dead = false) {
// combat scripting
}

Silver
I'd say flags are up there in the list of top scripts too. Um, actually that's just attributes isn't it?

HegemonKhan
ya, flags (booleans) are just one type of Attribute, and the 'set a variable or attribute' Script utilizes Attributes to make and adjust game stats (your Attributes), which are obviously an enormous part of what you want done in a game of your creation, laughs.

seriously, 90% of what you want to implement into your game is done with just these two powerful Super Scripts:

stats: 'set a variable or attribute' Script
altering stats (or flag~boolean conditionals): 'if ('set a variable or attribute' Script)' Script

game start stats:
if (player.race ="human") {
player.strength = 5
}

level up bonus stats:
if (player.race = "human") {
player.strength = player.strength + 2
}

etc examples:
if (player.strength_integer > 0 and player.strength_integer < 10) {
player.strength_string = "weak"
} else if (player.strength_integer >= 10 and player.strength_integer < 20) {
player.strength_string = "average"
} else if (player.strength_integer >= 20 and player.strength_integer < 30) {
player.strength_string = "strong"
}

if (player.strength > 50 and player.strength < 100) {
player.final_damage = (player.weapon_damage) + (player.weapon_damage * (player.strength / 100))
} else if (player.strength = 100) {
player.final_damage = (player.weapon_damage) + (player.weapon_damage * (player.strength / 50))
}

-------

the other 10% of game implementation deals with all the more advanced coding stuff, like lists (iterating through lists), dictionaries, and etc coding stuff way beyond my understanding, lol.

Zach
:mrgreen: Thanks, guys. I will definitely try all of those. :D :idea: 8)

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums