Note: please feel free to add this to the wiki pages! Just credit~mention me if you do, please.
---------
if you want to work on combat, then try to do it slowly, through the Verb Tab's add a~new scripts:
here you go, a quality STEP BY STEP "noob-proof" GUI~Editor usage guide, lol
"room" (the default Room Object that contains your default "player" Player Object) -> Objects (Tab) -> Add ->
name: orc
orc -> Verb (Tab) -> Add ->
name: fight
box: RUN A SCRIPT (this allows us to add scripts, as you'll see the button for it show up upon changing to this setting)
let's start off trying something really simple:
(by the way, hopefully you understandd that my "->" arrows in the front~left side, mean indenting ~ "nesting" the script ~ make sure you click on the correct "add a~new script" I-think-circular button, lol. Correct indenting~"nesting" is a MUST !!!, or your series of scripts won't work correctly!!!)
it attacks you first doing damage to you and receiving a message of this act, and then you attack it for damage and receiving a message of this act
Add a~new script -> Variables -> Set an attribute or variable -> player.hit_points = player.hit_points - orc.physical_damage
Add a~new script -> Output -> Print a message -> Print [EXPRESSION] orc.alias + " hits " + player.alias + " for " + orc.physical_damage + " damage, leaving " + player.alias + " with only " + player.hit_points + " hitpoints remaining."
Add a~new script -> Variables -> Set an attribute or variable -> orc.hit_points = orc.hit_points - player.physical_damage
Add a~new script -> Output -> Print a message -> Print [EXPRESSION] player.alias + " hits " + orc.alias + " for " + player.physical_damage + " damage, leaving " + orc.alias + " with only " + orc.hit_points + " hitpoints remaining."
okay, we've added our scripts for our "orc" Object's "fight" Verb, but now we need our "player" and "orc" Objects to actually have the attributes that are used in our "orc" Object's "fight" Verb script~code block.
the Objects involved:
player
orc
and their Attributes needed:
hit_points
physical_damage
alias
player -> Attributes (Tab) -> Attributes -> Add ->
Name: hit_points
Type: int
Value: 999 // or whatever amount you want to start with
Name: physical_damage
Type: int
Value: 50 // or whatever amount you want to start with
player -> Setup (Tab) -> Alias -> onimike // or whatever you want, lol
player -> Attributes (Tab) -> Status Attributes -> Add -> // so they'll be displayed on the right side while playing the game
Name: hit_points
Value: (leave blank)
Name: physical_damage
Value: (leave blank)
orc -> Attributes (Tab) -> Attributes -> Add ->
Name: hit_points
Type: int
Value: 200 // or whatever amount you want it to have
Name: physical_damage
Type: int
Value: 10 // or whatever amount you want it to have
orc -> Setup (Tab) -> Alias -> kul'dan
goob job, but let's now try to do more now:
we need a reason for doing damage: killing the orc, or dying and losing the game, hehe. Also, let's have you get experience and cash for killing the orc too.
so back to our "orc" Object's "fight" Verb, we got to add in some new lines~scripts:
Add a~new script -> Scripts -> If... -> if [EXPRESSION] // or if [OBJECT DOES NOT HAVE FLAG] -> orc.dead = false // or Object: orc, [flag name]: dead
Then,
-> Add a~new script -> Variables -> Set an attribute or variable -> player.hit_points = player.hit_points - orc.physical_damage
-> Add a~new script -> Output -> Print a message -> Print [EXPRESSION] orc.alias + " hits " + player.alias + " for " + orc.physical_damage + " damage, leaving " + player.alias + " with only " + player.hit_points + " hitpoints remaining."
-> Add a~new script -> Scripts -> If... -> if [EXPRESSION] player.hit_points <= 0 // we can't do [OBJECT ATTRIBUTE EQUALS] as I don't think there's any way to add in the "equals and less than" operator for it. As we've only got the "equals" operator, so this won't work for us.
-> then,
->-> Add a~new script -> Game State -> Finish the game
-> else,
->-> Add a~new script -> Variables -> Set an attribute or variable -> orc.hit_points = orc.hit_points - player.physical_damage
->-> Add a~new script -> Output -> Print a message -> Print [EXPRESSION] player.alias + " hits " + orc.alias + " for " + player.physical_damage + " damage, leaving " + orc.alias + " with only " + orc.hit_points + " hitpoints remaining."
->-> Add a~new script -> Scripts -> If... -> if [EXPRESSION] orc.hit_points <= 0 // we can't do [OBJECT ATTRIBUTE EQUALS] as I don't think there's any way to add in the "equals and less than" operator for it. As we've only got the "equals" operator, so this won't work for us.
->-> then,
->->-> Add a~new script -> Variables -> Set an attribute or variable -> player.experience_points = player.experience_points + orc.experience_points
->->-> Add a~new script -> Variables -> Set an attribute or variable -> player.cash = player.cash + orc.cash
->->-> Add a~new script -> Variables -> Set a variable or attribute // or Set Object Flag -> orc.dead=true // or Object: orc, [flag name]: dead
->-> else,
->->-> Add a~new script -> Scripts -> Run an object's script attribute // I think this will loop~do this "fight" Verb again, but if not, then remove~delete this script line! -> run object [name] [orc] script attribute [name] fight, Using parameter dictionary (leave blank)
else,
-> Add a~new script -> Output -> Print a message -> Print [EXPRESSION] orc.alias + " is already dead."
but, let's not forget to add the new actual attributes to our objects!
orc -> Attributes (Tab) -> Attributes -> Add ->
Name: dead
Type: boolean
Value: false
Name: experience_points
Type: int
Value: 100 // or whatever amount you want it to have
Name: cash
Type: int
Value: 50 // or whatever amount you want it to have
player -> Attributes (Tab) -> Attributes -> Add ->
Name: experience_points
Type: int
Value: 0 // or whatever amount you want to start with
Name: cash
Type: int
Value: 0 // or whatever amount you want to start with
player -> Attributes (Tab) -> Status Attributes -> Add -> // again, for these to be displayed on the right side while playing the game
Name: experience_points
Value: (leave blank)
Name: cash
Value: (leave blank)
alright, that's good enough for my help for now, it's your turn to see what new or extra complexity you can add to or do on your own, hehe.
Try to add in scripting that let's you choose whether to "attack" (physically: with a weapon or no weapon), "cast" (magic spells), "use an item", "run away" (escape), and~or whatever else
Hints: "Show a menu", "If...", and "Switch"
Try to script the enemy object with A.I. behaviors
Hint: "GetRandomInt", "If...", and "Switch"
You can also try to add in more complex Game Mechanics too (such as for doing physical damage)
Hint: "Print a message -> Print [EXPRESSION]", and Quest's engine recognizes math's "order of operations" thankfully, making this "easy" to write into the hinted at script.
---------------------
as can be seen by the amount of work this takes, it is so much easier to help people via code... lol. If you can learn to work with the code, it's so much easier and faster for us to help you! As helping~explaining through the GUI~Editor is a lot of work!
I could do this same thing in code, in like 5 minutes, where this took me maybe 1-2 hrs to do, argh!
just kidding, as I was a noob too, who couldn't work with the code either.