dont even read this ffs
GameBoy
14 Dec 2003, 16:47Cryophile
14 Dec 2003, 18:10lol it was already explained to you NOT to use playerid. All of the code in the with <#player#> will cause userid to refer to #player#'s userid. If it is not in the with statement, then it will refer to the player that typed it in. You shouldn't even need $name(#player#)$ at all. Simply use #@player# and it will give you the player's alias (name). You will need the playerid variable to reflect the attacker's id if the attack variable is refering to the attacker's strength or something.This code should work. To make it easier to code you should use attack as a property. I'll change that. The additional code you wanted added will work if the attack property of Squiggle (set at init or otherwise) is 10000 or whatever. Do this with:
Put that in the player init.
Change all playerid's to userid. As long as the #player# has a variable attack, you should be safe. So with everything, this is:
If you want it otherwise, I'm sure you can code it yourself.
if ( $name(%userid%)$ = Squiggle ) then property <Squiggle; attack=9999>
Put that in the player init.
Change all playerid's to userid. As long as the #player# has a variable attack, you should be safe. So with everything, this is:
command </a #@player#> if property <#quest.currentroom[userid]#; pkon> then {
set numeric <playerid; %userid%>
with <#player#> {
dec <hp[userid]; $objectproperty($name(%playerid%)$>
if ( %hp[userid]% <= 0 ) then {
msg <|bYOU HAVE DIED|xb>
goto <Carbralos Tavern>
set numeric <hp[userid]; 100>
}
else msg <You were attacked and have lost 7 HP.>
}
msg <You attacked #@player# for |b7|xb HP.>
}
else msg <|bYou cant attack here!|xb>
If you want it otherwise, I'm sure you can code it yourself.
GameBoy
14 Dec 2003, 20:45Cryophile
14 Dec 2003, 22:48Errr, well, it's a start. I didn't test it or check the reference so there may be some syntax errors. Also, the property I added needs to exist or it will give an error. So add the attack property to each player in the initialization (player startup).
GameBoy
15 Dec 2003, 00:04codingmasters
15 Dec 2003, 00:10I'm assuming your talking about a multiplayer game here, but if you want a small battle engine for single player, check out my current game, Freak School. It uses a timer in conjunction with status variables to create a sort of battle engine.
Matthew G.
Matthew G.
GameBoy
15 Dec 2003, 13:30Cryophile
15 Dec 2003, 16:13I noticed one thing immediately. You have:
WHAT?!
What's the property?
You can use properties as:
$objectproperty(object;property)$
or
#object:property#
You cannot have a function within a function or a string within a string. Therefore, use a string within a function or a function within a string.
dec <hp[userid]; $objectproperty($name(%playerid%)$>
WHAT?!
dec <hp[userid]; #$name(%playerid%)$:thisistheproperty#>
What's the property?
You can use properties as:
$objectproperty(object;property)$
or
#object:property#
You cannot have a function within a function or a string within a string. Therefore, use a string within a function or a function within a string.
Cryophile
15 Dec 2003, 16:23Also, you wouldn't be using %attack[userid% since it's not a variable. It's a property, remember? So you would use #$name(%userid%)$:attack# which will give you the attack property of the character that the script is refering to (either the player who typed the command, or the player indicated in a "with" command). That should help out. I'm at school now, so I can't test the code.
You forgot to add this to the player startscript:
I think these are the proper commands. I don't have any reference to check, but I think it's right.
REMEMBER: attack is no longer a numeric variable. It's a property.
You forgot to add this to the player startscript:
if ( $name(%userid%)$ = Squiggle ) or ( $name(%userid%)$ = TheNobleOne ) then {
property <$name(%userid%)$;attack=9993>
}
else {
property <$name(%userid%)$;attack=7>
}
I think these are the proper commands. I don't have any reference to check, but I think it's right.
REMEMBER: attack is no longer a numeric variable. It's a property.
Cryophile
15 Dec 2003, 16:55Maybe you should add a defense variable/property to counteract the attack property. This would be to make it possible to miss and/or reduce damage.
GameBoy
15 Dec 2003, 18:39I think Im Dead
15 Dec 2003, 19:46The problem is you are a retard.
I'll post a battle engine with easy instructions to implement it for anybody interested. Eh, it has an engagement system supporting melee, polearm, ranged and room effect combat, there's no magic system implemented yet, but it'd be easy for anyone to make their own.
I'll post a battle engine with easy instructions to implement it for anybody interested. Eh, it has an engagement system supporting melee, polearm, ranged and room effect combat, there's no magic system implemented yet, but it'd be easy for anyone to make their own.
Cryophile
15 Dec 2003, 21:26POST REMOVED
GameBoy
15 Dec 2003, 23:39well im 16, 17 next april, in college (UK), and i'm not a retard thank you very much, and as for a half-ass job, well im so sorry. in conclusion to the abuse and utter-most pathetic replies i get, i choose not to seek help from anymore users of this forum.
Cryophile
15 Dec 2003, 23:54Errr, I apologize for any abuse I may or may not have given. I only ask that you check the Quest reference before asking any questions. All of these problems could have been solved. I try not to be insulting but I get irritated sometimes. Sorry 
paul_one
16 Dec 2003, 09:04Why were Ste's first posts removed? I didn't see anything wrong with the first load....
Apart from his lack of ASL coding knowledge that is.
Had a quick scan at work and saw what a mess it was. Looking for variables which were really properties and all that....... "Whatever" = I say!
Apart from his lack of ASL coding knowledge that is.
Had a quick scan at work and saw what a mess it was. Looking for variables which were really properties and all that....... "Whatever" = I say!
Anonymous
16 Dec 2003, 12:23The fact is, i've never taken the time to sit at my computer and learn how to hand code until now, OF COURSE my code and stuff is going to be messed up.....In time i'll learn, u can just wake up one morning and start coding, it takes practise, even with something as simple as ASL. 8)
GameBoy
16 Dec 2003, 17:05can't*
Cryophile
16 Dec 2003, 18:20I didn't mean to sound offensive, Ste. Sometimes it comes out that way when I get confused/frustrated. If you do an excellent job coding one day then screw up the next, it gets weird. I'm a strange person 
Also, I didn't realize you didn't handcode at all. At least I'm not as insulting as ITID who seems to take every chance he can to insult you.
Also, I didn't realize you didn't handcode at all. At least I'm not as insulting as ITID who seems to take every chance he can to insult you.
paul_one
17 Dec 2003, 08:13..... Subtlety isn't one of his strong points....
GameBoy
17 Dec 2003, 14:26lol. Hes a great ASL coder though, gotta give him that.
Cryophile
17 Dec 2003, 16:46Computer Whizz wrote:..... Subtlety isn't one of his strong points....
GameBoy
23 Dec 2003, 00:37Computer Whizz wrote:..... Subtlety isn't one of his strong points....
/me nods