dont even read this ffs

GameBoy

Cryophile
lol 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:

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

Cryophile
Errr, 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

codingmasters
I'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.

GameBoy

Cryophile
I noticed one thing immediately. You have:

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
Also, 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:



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
Maybe 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

I think Im Dead
The 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.

Cryophile
POST REMOVED

GameBoy
well 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
Errr, 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 :oops:

paul_one
Why 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!

Anonymous
The 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
can't*

Cryophile
I 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 :twisted:
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
..... Subtlety isn't one of his strong points....

GameBoy
lol. Hes a great ASL coder though, gotta give him that.

Cryophile
Computer Whizz wrote:..... Subtlety isn't one of his strong points....


:lol:

GameBoy
Computer Whizz wrote:..... Subtlety isn't one of his strong points....


/me nods

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

Support

Forums