Some Questions

Opulus
13 Jan 2014, 10:08Hey ho!
I'm having problems with exits ^^ I have an Exit that goes up, it's a rockface, and I want the player first to find some gloves before he can climb up. I tried to lock the Exit with an message like "You can not climb that wall is too rough" and unlock it if the player is wearing the Gloves.
My Problem is that I don't know how I let the player wearing the gloves xD
I tried the Use/Give option but If I do that the player can use it on it's own but he cant "wear" it, and this is a bit too unrealistic...
How can the player "wear" the Gloves?
--------------------
So I din't realy tried it jet, but I know I'll have problems with that so I better ask now before I have to open a new toppic ^^
I want some Exits to be locked, so they can be unlocked with a key. How do I do that?
Other Exits should be blocked by things like a rock or something, so the player needs a Pickaxe to breake the rock first.
Oh and If I talk about the rock... what do I have to do if I want the player to use the picaxe more than one time to brake the rock?
And I want the Picaxe to be broken after the Rock is broken ^^
And the third thing is that I want to script something like falling Rocks over the Exit the player comes from when he enters the room. So he cant leave.
I'm sorry for asking so many things.. but sometimes I do not understand what is standing in the Quest wiki, or can't find it so I hope one of you could help me.
Greetings, Opulus.
I'm having problems with exits ^^ I have an Exit that goes up, it's a rockface, and I want the player first to find some gloves before he can climb up. I tried to lock the Exit with an message like "You can not climb that wall is too rough" and unlock it if the player is wearing the Gloves.
My Problem is that I don't know how I let the player wearing the gloves xD
I tried the Use/Give option but If I do that the player can use it on it's own but he cant "wear" it, and this is a bit too unrealistic...
How can the player "wear" the Gloves?
--------------------
So I din't realy tried it jet, but I know I'll have problems with that so I better ask now before I have to open a new toppic ^^
I want some Exits to be locked, so they can be unlocked with a key. How do I do that?
Other Exits should be blocked by things like a rock or something, so the player needs a Pickaxe to breake the rock first.
Oh and If I talk about the rock... what do I have to do if I want the player to use the picaxe more than one time to brake the rock?
And I want the Picaxe to be broken after the Rock is broken ^^
And the third thing is that I want to script something like falling Rocks over the Exit the player comes from when he enters the room. So he cant leave.
I'm sorry for asking so many things.. but sometimes I do not understand what is standing in the Quest wiki, or can't find it so I hope one of you could help me.
Greetings, Opulus.
HegemonKhan
13 Jan 2014, 22:24how complex do you want "wearing" your gloves (or your "wearing" game element~feature itself) to be?
some options:
1. simply checking if the "item" (the "gloves" Object) is in your inventory:
// I'll have to check exactly how the syntax is, as this is just a guess (too lazy to look it up at the moment, lol)
if (Contains (ScopeInventory, gloves) {
-> // unlock exit
} else {
-> msg ("You need the gloves first")
}
2. a single simple string attribute:
// after getting~finding (taking) the gloves (into your inventory)
player.equipped = gloves
if (player.equipped = gloves) {
-> // unlock exit
} else {
-> msg ("You need the gloves first")
}
3. an equipment system, either simple or complex
viewtopic.php?f=18&t=2901
viewtopic.php?f=18&t=2567
(Pertex' Combat Library also has an equipment coding too, but it's more specialized for his combat library and it's a bit "code-heavy" to understand, so I'm only mentioning it here, instead of pasting the link for his combat library here)
viewtopic.php?f=18&t=3515
viewtopic.php?f=18&t=2557
----------------------
Exits:
(all from the wiki's tutorial, http://quest5.net/wiki/Tutorial )
http://quest5.net/wiki/Creating_a_simple_game
http://quest5.net/wiki/Using_lockable_exits
http://quest5.net/wiki/Using_lockable_exits
http://quest5.net/wiki/Using_lockable_containers (not dealing with an Exit, but deals with "locking" still, you may want to use this in your game possibly)
from the wiki's "how to" ( http://quest5.net/wiki/How_to ):
http://quest5.net/wiki/Hs-blockingexit
http://quest5.net/wiki/Hs-lockedexits
http://quest5.net/wiki/Hiddenexit
--------------------------
1. "so the player needs a Pickaxe to breake the rock first (opulus)"
use the "Use" feature
for conceptual example:
rock.broken = false
use pickaxe on rock
rock.broken = true
if (rock.broken = true) {
-> // unlock exit
} else if (rock.broken = false) {
-> msg ("You need to break the rock first")
}
2. "what do I have to do if I want the player to use the picaxe more than one time to brake the rock (opulus)?"
for conceptual example:
rock.broken = false
rock.pickaxe_use_count = 0
pickaxe.durability = 3
pickaxe.broken = false
use pickaxe on rock
if (pickaxe.broken = true) {
-> msg ("your pickaxe is broken, you'll have to find another one")
} else if (pickaxe.broken = false) {
-> rock.pickaxe_use_count = rock.pickaxe_use_count + 1
-> pickaxe.durability = pickaxe.durability - 1
}
if (rock.pickaxe_use_count = 3) {
-> rock.broken = true
}
if (rock.broken = true) {
-> // unlock exit
} else if (rock.broken = false) {
-> msg ("You need to break the rock first")
}
if (pickaxe.durability = 0) {
-> pickaxe.broken = true
}
3. "And the third thing is that I want to script something like falling Rocks over the Exit the player comes from when he enters the room. So he cant leave (oculus)."
"OnEnterRoom" Script:
// lock exit
msg ("the boulders fall over the exit behind you, blocking you from using it, at least you got through the exit before getting crushed to death by them... maybe if you could find something to break the boulders, you can get back through the exit again")
some options:
1. simply checking if the "item" (the "gloves" Object) is in your inventory:
// I'll have to check exactly how the syntax is, as this is just a guess (too lazy to look it up at the moment, lol)
if (Contains (ScopeInventory, gloves) {
-> // unlock exit
} else {
-> msg ("You need the gloves first")
}
2. a single simple string attribute:
// after getting~finding (taking) the gloves (into your inventory)
player.equipped = gloves
if (player.equipped = gloves) {
-> // unlock exit
} else {
-> msg ("You need the gloves first")
}
3. an equipment system, either simple or complex
viewtopic.php?f=18&t=2901
viewtopic.php?f=18&t=2567
(Pertex' Combat Library also has an equipment coding too, but it's more specialized for his combat library and it's a bit "code-heavy" to understand, so I'm only mentioning it here, instead of pasting the link for his combat library here)
viewtopic.php?f=18&t=3515
viewtopic.php?f=18&t=2557
----------------------
Exits:
(all from the wiki's tutorial, http://quest5.net/wiki/Tutorial )
http://quest5.net/wiki/Creating_a_simple_game
http://quest5.net/wiki/Using_lockable_exits
http://quest5.net/wiki/Using_lockable_exits
http://quest5.net/wiki/Using_lockable_containers (not dealing with an Exit, but deals with "locking" still, you may want to use this in your game possibly)
from the wiki's "how to" ( http://quest5.net/wiki/How_to ):
http://quest5.net/wiki/Hs-blockingexit
http://quest5.net/wiki/Hs-lockedexits
http://quest5.net/wiki/Hiddenexit
--------------------------
1. "so the player needs a Pickaxe to breake the rock first (opulus)"
use the "Use" feature
for conceptual example:
rock.broken = false
use pickaxe on rock
rock.broken = true
if (rock.broken = true) {
-> // unlock exit
} else if (rock.broken = false) {
-> msg ("You need to break the rock first")
}
2. "what do I have to do if I want the player to use the picaxe more than one time to brake the rock (opulus)?"
for conceptual example:
rock.broken = false
rock.pickaxe_use_count = 0
pickaxe.durability = 3
pickaxe.broken = false
use pickaxe on rock
if (pickaxe.broken = true) {
-> msg ("your pickaxe is broken, you'll have to find another one")
} else if (pickaxe.broken = false) {
-> rock.pickaxe_use_count = rock.pickaxe_use_count + 1
-> pickaxe.durability = pickaxe.durability - 1
}
if (rock.pickaxe_use_count = 3) {
-> rock.broken = true
}
if (rock.broken = true) {
-> // unlock exit
} else if (rock.broken = false) {
-> msg ("You need to break the rock first")
}
if (pickaxe.durability = 0) {
-> pickaxe.broken = true
}
3. "And the third thing is that I want to script something like falling Rocks over the Exit the player comes from when he enters the room. So he cant leave (oculus)."
"OnEnterRoom" Script:
// lock exit
msg ("the boulders fall over the exit behind you, blocking you from using it, at least you got through the exit before getting crushed to death by them... maybe if you could find something to break the boulders, you can get back through the exit again")