How come when I call my proc in the my Equip verb the rest of the Equip verb dosn't finish?
Here is the coding:
SwordLv1
icon = 'Weapons.dmi'
icon_state = "SwordLv1"
verb
Equip()
var/plus = 20
var/weaponon = 0
EquipProc(plus,weaponon,wtype)
if(weaponon == 1)
if(usr.icon_state == "Shield")
usr.icon_state = "SwordAndShield"
else
usr.icon_state = "Sword"
usr.RightArm = "Wooden Sword"
usr << "You equiped a Wooden Sword!"
Now the Proc:
obj/proc/EquipProc(plus,weaponon,wtype)
if(wtype == "DamageWeapon")
if(usr.rightarmequiped == 1)
usr<<"You are already holding something in your right arm!"
weaponon = 0
else
usr.rightarmequiped = 1
usr.strengh += plus
weaponon = 1
return weaponon
else
if(usr.leftarmequiped == 1)
usr<<"You are already holding something in your right arm!"
else
usr.leftarmequiped = 1
usr.defense += plus
weaponon = 1
return weaponon
Thank you for your Help!
ID:175920
Feb 26 2003, 4:48 pm
|
|
In response to Goku72
|
|
Actually, it won't. His problem is that weaponon is 0, and thus, the if() statement fails. When you pass a variable into a proc as an argument, any changes to that variable only exist inside that proc. You'll have to use:
if(EquipProc(plus,weaponon,wtype) == 1) ... |
In response to Garthor
|
|
Dosn't that check all the variables, plus, weaponon, and wtype, I just want weaponon checked.
|
In response to SSChicken
|
|
No. When you have "return X" in a proc, then you can use that proc in an if() statement, or assign something to it. The proc will then be run, and whatever the X is in "return X" will be evaluated, or set to the variable. For example:
mob verb Hello() world << HelloWorld() proc HelloWorld() return "Hello world!" That will print out "Hello world!", because that value was returned. Get it? |
In response to Lummox JR
|
|
Is this LJR maker of Space traders? If you did I would like to play that game, but I dont have the money on byond and i don't send in money. I'd just like to see your game become free sometime.
Sincerely, Sonder |
In response to Sonder
|
|
No, that's Lummox JR, not LJR. Can you not read?
|
In response to Sonder
|
|
Sonder wrote:
Is this LJR maker of Space traders? If you did I would like to play that game, but I dont have the money on byond and i don't send in money. I'd just like to see your game become free sometime. LJR is the alternate key of LordJR, the author of Star Traders. It was a questionable move on his part to choose that as the alternate, given that it could just as easily be short for my own name, but it's done. I'd like to see his game become free too, considering I wasted money on a subscription to play it myself and after all that time he never put in a friggin' save feature. Lummox JR |
Put spawn() EquipProc() and that'll solve your problem.