Help with Combat/Map/Spell system
DokaNoker
15 Aug 2013, 17:51Hi
I have had a problem with my combat system because
1. I cannot respawn
2. I only know how much i was hurt when i die, i cannot see my health drop
3. If the monsters die, they still attack
And for the map
1.If you go to the castle, the map goes crazy, with the player icon being in a different place then the map cubes.
EDIT:
By the way, the spells wont hurt .
I have had a problem with my combat system because
1. I cannot respawn
2. I only know how much i was hurt when i die, i cannot see my health drop
3. If the monsters die, they still attack
And for the map
1.If you go to the castle, the map goes crazy, with the player icon being in a different place then the map cubes.
EDIT:
By the way, the spells wont hurt .

jaynabonne
15 Aug 2013, 22:35For the map, it goes crazy because your rooms and exits are not consistent. The exit leading to the castle has length 3, but the one leading away from the castle has length 1. So the map draws a length 3 line when you head northeast, but coming back, it only returns 1, and doesn't make it visually to the target room.
(Also, from your first room, both north and south go to the same room!)
(Also, from your first room, both north and south go to the same room!)

jaynabonne
15 Aug 2013, 22:45For 2), you don't see your health decrease during combat because your status is showing the "health" attribute, whereas the combat library is using an attribute called "hitpoints".
HegemonKhan
16 Aug 2013, 01:161. If you mean that when the game is over, the game is over, and thus you can't keep playing (ie "respawning"), then you have to remove the "finish" coding lines (and its script blocks) from Pixie's Library.
implementing a "dead" functional-game-status (preventing you from doing only some stuff ~ unlike the "finish" coding which prevents you from doing any~all stuff, and also along with a "revival" potion or whatever feature to revive you), is very much more complicated, and will take some work and explanation.
2. I edited this in later to my previous post (but you must not have seen it in time), so you didn't know about it, my apologies!
because of my too late edit addition to my previous post, you thus messed up on one of the "player" Player Object's attributes:
you have it looking like this:
<statusattributes type="stringdictionary" />
needs to be changed to (look like) this:
<statusattributes type="simplestringdictionary">hitpoints =;armour =;attack =;defence =</statusattributes>
~AND~OR~
you can add in script lines to Pixie's Library, to display your current~new hitpoint_amount (after getting hit by the monsters).
this will take some explanation too, if you don't know what you're doing. Add this line where it's needed or where you want it:
msg (game.pov.alias + " has " + game.pov.hitpoints + " HP remaining.")
3. I forgot to notice this and tell it to you in my previous post, my apologies!
you need to also add this Attribute to all of your "monster" Objects:
"whatever_your_monster_object_name" Object -> Attributes (Tab) -> Attributes -> Add ->
Name: dead
Type: boolean
Value: false
~OR~
in Pixie's Library File:
find the "monster" Object Type coding block:
and add in this line to it:
<dead type="boolean">false</dead>
it should look like this:
implementing a "dead" functional-game-status (preventing you from doing only some stuff ~ unlike the "finish" coding which prevents you from doing any~all stuff, and also along with a "revival" potion or whatever feature to revive you), is very much more complicated, and will take some work and explanation.
2. I edited this in later to my previous post (but you must not have seen it in time), so you didn't know about it, my apologies!
because of my too late edit addition to my previous post, you thus messed up on one of the "player" Player Object's attributes:
you have it looking like this:
<statusattributes type="stringdictionary" />
needs to be changed to (look like) this:
<statusattributes type="simplestringdictionary">hitpoints =;armour =;attack =;defence =</statusattributes>
~AND~OR~
you can add in script lines to Pixie's Library, to display your current~new hitpoint_amount (after getting hit by the monsters).
this will take some explanation too, if you don't know what you're doing. Add this line where it's needed or where you want it:
msg (game.pov.alias + " has " + game.pov.hitpoints + " HP remaining.")
3. I forgot to notice this and tell it to you in my previous post, my apologies!
you need to also add this Attribute to all of your "monster" Objects:
"whatever_your_monster_object_name" Object -> Attributes (Tab) -> Attributes -> Add ->
Name: dead
Type: boolean
Value: false
~OR~
in Pixie's Library File:
find the "monster" Object Type coding block:
<type name="monster">
// blah coding
</type>
and add in this line to it:
<dead type="boolean">false</dead>
it should look like this:
<type name="monster">
<inherit name="weapon" />
<dead type="boolean">false</dead>
<defence type="int">0</defence>
// blah coding ~ ie the rest of the coding
</type>
DokaNoker
16 Aug 2013, 17:56ZOh by the way
zEven if the monsters die, they Still attack
and i get this error
Error running script: Error compiling expression 'monster': Unknown object or variable 'monster'
zEven if the monsters die, they Still attack
and i get this error
Error running script: Error compiling expression 'monster': Unknown object or variable 'monster'
HegemonKhan
17 Aug 2013, 06:31can you post your game file (and Pixie's Library File if you made changes to it) again, and I'll have a look at it (and provide you directly with edited files that will work) ???
------------
I'm not quite sure how Pixie's Combat Library works, but try his~her Game Demo, and see if the enemy Objects will attack you after they're dead. If they do, then Pixie forgot some code lines or stuff, if not, then we just need to see what you're missing that is needed to get it to work.
-----------
ignoring Pixie's Combat Library, the basic way of implementing it is this:
give your "enemy" Objects a boolean attribute (for example: orc.dead=false)
in the script block where you kill the "enemy" Object, you need this code~script line: orc.dead=true
and, back to the "enemy" Object's "attack" verb script block, at the very beginning (top) of it, you need a "check" (conditional):
if (orc.dead = false) {
-> // the orc attacks and damages you, and you attack and damage it too
} else if (orc.dead = true) {
-> // nothing happens to you, either don't message anything or message something to this effect: msg ("The orc is already dead, you can't fight it, you can't attack what is already dead, and it's corpse can't attack you, either")
// so....
since the "orc" isn't dead yet when you begin, it attacks you and you attack it, and hopefully the "orc" dies, lol.
now that the orc is dead (via setting it's "dead" boolean to "true", after it's HP is zero or less), if you try to attack it again, it skips the fight scripting, and either ends doing nothing or it'll display your message to the effect that it says nothing happens, as the orc is already dead.
-------------
your error message is just due to an error in the coding, often a simple mistake by you; a typo or whatever (very annoying to try to find, ie "trouble shoot", them... lol). Errors are very common, welcome to Trouble Shooting your game~code, muhaha!
------------
I'm not quite sure how Pixie's Combat Library works, but try his~her Game Demo, and see if the enemy Objects will attack you after they're dead. If they do, then Pixie forgot some code lines or stuff, if not, then we just need to see what you're missing that is needed to get it to work.
-----------
ignoring Pixie's Combat Library, the basic way of implementing it is this:
give your "enemy" Objects a boolean attribute (for example: orc.dead=false)
in the script block where you kill the "enemy" Object, you need this code~script line: orc.dead=true
and, back to the "enemy" Object's "attack" verb script block, at the very beginning (top) of it, you need a "check" (conditional):
if (orc.dead = false) {
-> // the orc attacks and damages you, and you attack and damage it too
} else if (orc.dead = true) {
-> // nothing happens to you, either don't message anything or message something to this effect: msg ("The orc is already dead, you can't fight it, you can't attack what is already dead, and it's corpse can't attack you, either")
// so....
since the "orc" isn't dead yet when you begin, it attacks you and you attack it, and hopefully the "orc" dies, lol.
now that the orc is dead (via setting it's "dead" boolean to "true", after it's HP is zero or less), if you try to attack it again, it skips the fight scripting, and either ends doing nothing or it'll display your message to the effect that it says nothing happens, as the orc is already dead.
-------------
your error message is just due to an error in the coding, often a simple mistake by you; a typo or whatever (very annoying to try to find, ie "trouble shoot", them... lol). Errors are very common, welcome to Trouble Shooting your game~code, muhaha!
