ID:146153
 
I have a problem ive got some icons which i made up and tested them in my game they work but when i go to try and edit myself i still get 0 powerlevel and it doesnt increase.nor when i try and hit a punchingbag or speedbag it just stays at zero here my speedbag coding

obj
SpeedBag
icon = 'weight-objs1.dmi'
icon_state = "speed"
density = 1
verb
SpeedBag()
set name = "Speed-Bag"
set category = "Training"
set src in oview(1)
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0 && usr.maxpowerlevel>=20000)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speedhit",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=2
usr.icon_state = ""
usr.maxpowerlevel += 1
usr.exp += 1/5
usr.meditate = 0
usr.levelcheck()
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 3)
usr.move = 1
usr.stamina-=3
usr.icon_state = ""
usr.maxpowerlevel += 5
usr.lvlcheck()
usr.exp+=rand(1,2)
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."

obj
Punchingbag
icon = 'pbags.dmi'
icon_state = "speed bag 1"
density = 1
verb
Punchingbag()
set name = "Punching Bag"
set category = "Training"
set src in oview(1)
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit 1",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=rand(4,6)
usr.icon_state = ""
usr.maxpowerlevel += 25
usr.exp += 1/2
usr.meditate = 0
usr.levelcheck()
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 3)
usr.move = 1
usr.stamina-=rand(5,7)
usr.icon_state = ""
usr.maxpowerlevel += 50
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."

obj
Punchingbag2
icon = 'pbags.dmi'
icon_state = "speed bag 2"
density = 1
verb
Punchingbag2()
set name = "Punching Bag 2"
set category = "Training"
set src in oview(1)
if(usr.maxpowerlevel <= 499999)
usr << "You are not at 500,000"
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0 && usr.maxpowerlevel>=500000)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit 2",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=rand(7,10)
usr.icon_state = ""
usr.maxpowerlevel += 75
usr.exp += 1/5
usr.meditate = 0
usr.levelcheck()
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 3)
usr.move = 1
usr.stamina-=rand(6,9)
usr.icon_state = ""
usr.maxpowerlevel += 200
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."

obj
Punchingbag3
icon = 'pbags.dmi'
icon_state = "speed bag 3"
density = 1
verb
Punchingbag3()
set name = "Punching Bag 3"
set category = "Training"
set src in oview(1)
if(usr.maxpowerlevel <= 4999999)
usr << "You are not at 5,000,000"
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0 && usr.maxpowerlevel >= 5000000)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit 3",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 2000
usr.exp += 1/5
usr.meditate = 0
usr.levelcheck()
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 3)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 1000
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."

obj
Punchingbag4
icon = 'pbags.dmi'
icon_state = "speed bag 4"
density = 1
verb
Punchingbag4()
set name = "Punching Bag 4"
set category = "Training"
set src in oview(1)
if(usr.maxpowerlevel <= 49999999)
usr << "You are not at 50 Million Power Level!"
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0 && usr.maxpowerlevel >= 50000000)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit 4",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 3000
usr.exp += 1/5
usr.meditate = 0
usr.levelcheck()
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 13)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 2500
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."

obj
Punchingbag5
icon = 'pbags.dmi'
icon_state = "speed bag 5"
density = 1
verb
Punchingbag5()
set name = "Punching Bag 5"
set category = "Training"
set src in oview(1)
if(usr.maxpowerlevel <= 299999999)
usr << "You are not at 300 Million power level!"
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0 && usr.maxpowerlevel >= 300000000)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit 5",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 5000
usr.exp += 1/5
usr.meditate = 0
usr.levelcheck()
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 3)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 7500
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."
obj
Punchingbag6
icon = 'pbags.dmi'
icon_state = "speed bag 5"
density = 1
verb
Punchingbag6()
set name = "Punching Bag 6"
set category = "Training"
set src in oview(1)
if(usr.maxpowerlevel <= 499999999)
usr << "You are not at 500 Million power level!"
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0 && usr.maxpowerlevel >= 300000000)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit 5",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 5000
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 3)
usr.move = 1
usr.stamina-=rand(1,5)
usr.icon_state = ""
usr.maxpowerlevel += 7500
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."
obj
Strengthbag
icon = 'pbags.dmi'
icon_state = "speed bag 5"
density = 1
verb
AttackMob()
set name = "Strengthbag"
set category = "Training"
set src in oview(1)
if(usr.maxpowerlevel <= 5)
usr << "You are not at 5 power level!"
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0 && usr.maxpowerlevel >= 5)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit 5",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr << "<b><font size = 4>You feel more skillful in your fighting techinques"
usr.Strength += 1
else
usr.maxpowerlevel += 0

else
usr << "You are too weak to continue!."


Here is my edit coding

        Edit(obj/O as obj|mob|turf|area in view())
set category = "Police"
set desc="(target) Edit a target item's variables"
var/variable = input("Which var?","Var") in O.vars
var/default
var/typeof = O.vars[variable]
var/dir
if(variable == "gmlevel")
usr << "The Master GMs have disabled the var GMLEVEL from changing. This is a GM variable."
return
if(isnull(typeof))
usr << "Unable to determine variable type."

else if(isnum(typeof))
usr << "Variable appears to be <b>NUM</b>."
default = "num"
dir = 1

else if(istext(typeof))
usr << "Variable appears to be <b>TEXT</b>."
default = "text"

else if(isloc(typeof))
usr << "Variable appears to be <b>REFERENCE</b>."
default = "reference"

else if(isicon(typeof))
usr << "Variable appears to be <b>ICON</b>."
typeof = "\icon[typeof]"
default = "icon"

else if(istype(typeof,/atom) || istype(typeof,/datum))
usr << "Variable appears to be <b>TYPE</b>."
default = "type"

else if(istype(typeof,/list))
usr << "Variable appears to be <b>LIST</b>."
default = "cancel"

else if(istype(typeof,/client))
usr << "Variable appears to be <b>CLIENT</b>."
default = "cancel"

else
usr << "Variable appears to be <b>FILE</b>."
default = "file"

usr << "Variable contains: [typeof]"
if(dir)
switch(typeof)
if(1)
dir = "NORTH"
if(2)
dir = "SOUTH"
if(4)
dir = "EAST"
if(8)
dir = "WEST"
if(5)
dir = "NORTHEAST"
if(6)
dir = "SOUTHEAST"
if(9)
dir = "NORTHWEST"
if(10)
dir = "SOUTHWEST"
else
dir = null
if(dir)
usr << "If a direction, direction is: [dir]"
var/class = input("What kind of variable?","Variable Type",default) in list("text",
"num","type","reference","icon","file","restore to default","cancel")

switch(class)
if("cancel")
return

if("restore to default")
O.vars[variable] = initial(O.vars[variable])

if("text")
O.vars[variable] = input("Enter new text:","Text",\
O.vars[variable]) as text

if("num")
O.vars[variable] = input("Enter new number:","Num",\
O.vars[variable]) as num

if("type")
O.vars[variable] = input("Enter type:","Type",O.vars[variable]) \
in typesof(/obj,/mob,/area,/turf)

if("reference")
O.vars[variable] = input("Select reference:","Reference",\
O.vars[variable]) as mob|obj|turf|area in world

if("file")
O.vars[variable] = input("Pick file:","File",O.vars[variable]) \
as file

if("icon")
O.vars[variable] = input("Pick icon:","Icon",O.vars[variable]) \
as icon


I get no errors or anything
Sad to say, usr abuse.
In response to Sniper Joe
should i change usr to mob or somthing?
In response to Sniper Joe
I though usr was okay to use in verbs?
In response to Popisfizzy
It is.
In response to Polaruis
Then where is there usr abuse?
I found a problem!
You're using Zeta!
In response to Ol' Yeller
How did Zeta's code get out there?
In response to Popisfizzy
What if the gm edit function is the same as zeta

And the punching bag isnt zeta i coded that myself
You have little hope of debugging such gigantic code segments, which is why I told you last time that you need to start posting only the relevant stuff.

In this case though I have something helpful to offer: Don't do that Punchingbag, Punchingbag2, Punchingbag3 crap with so much repeated code. Instead make one punchingbag type, and give it vars that represent the differences between them (i.e., in how much they can train you). You can even make one type with vars, and then subtype it to just override particular parts. There's no reason you should be copying that much code just to make subtle alterations. Any time you find yourself doing that, it's a sign of a design flaw and that you can surely compact your code.

Fixing that horrific design flaw will make it easier, or rather at all possible, to debug your code.

Lummox JR
In response to Sniper Joe
Sniper Joe wrote:
Sad to say, usr abuse.

Sad to say, 'usr abuse' abuse.

-tezz
In response to Sniper Joe
Sniper Joe wrote:
Sad to say, usr abuse.

Govegtos' code may be full of problems, but usr abuse isn't one of them. The mere instance of "usr" in a snippet of code does not make usr abuse. Please read the usr lecture.

I'm glad that you're so eager to help people, but posting the wrong information only confuses others. Next time, please think more carefully before you post.
In response to Wizkidd0123
Why does everyone make dbz games.. come on.. let your imagination run wild and make something different.. gosh.. all the dbz games are the same anyways basicly.. well the majority of them are.
In response to Ehlert
Ehlert wrote:
Why does everyone make dbz games.. come on.. let your imagination run wild and make something different.. gosh.. all the dbz games are the same anyways basicly.. well the majority of them are.

Build Your Own Net Dream. 'nuf said. It's their dream, let 'em be.
In response to Govegtos
Govegtos wrote:
should i change usr to mob or somthing?

Please, if you wish to ask for our help to assist you in learning the DM language to better your programming skills you seriously need to drop the Zeta code. It's probably the worst way to learn how to program. Obviously, you're not getting anywhere because you keep posting mass sections of code that are flawed, ill thought out and absoloutely rubbish. You've been with us since 2003, and have been posting for help with code problems ever since.

I seriously recommend you head on over to the Demos section of the resources, download a few and see exactly what makes what work. Check out BYONDscape for tutorials and check up on how to use certain functions in the DM Reference and Guide. Work towards being able to program robustly. Anyone can do it given time and determination.

As for your code problem - No. Don't change usr to mob. It's pointless, usr is valid here. Your problem could be anywhere. Your maxpowerlevel won't rise even if you edit it? Perhaps you have a loop that keeps setting your maxpowerlevel var to 0? You haven't given enough details for anyone to really be able to help you other than to tell you that your "speedbag" code is shocking.


When did the problem start happening? Is there anything that you did / editted that could have triggered this problem?

~Sinyc.
In response to Teh Governator
Teh Governator wrote:
Ehlert wrote:
Why does everyone make dbz games.. come on.. let your imagination run wild and make something different.. gosh.. all the dbz games are the same anyways basicly.. well the majority of them are.

Build Your Own Net Dream. 'nuf said. It's their dream, let 'em be.

lol.. still I dont think their own dream involves coding thats basicly the same in the other games..
In response to Sinyc
Give it up dude, hes such a n00b, he wont listen
In response to SSJ4 Compufreak
SSJ4 Compufreak wrote:
Give it up dude, hes such a n00b, he wont listen

It's sad you know. *sigh*

Everyone has to start somewhere, and Govegtos has an awesome attitude towards developing and being a part of the community - he just lacks the knowledge of DM. It's a shame he's too stubborn to really crack down and learn the language in depth.

Frustrating when you want to help someone that won't listen.
In response to Sinyc
Govegtos has an awesome attitude towards developing and being a part of the community

Really?
Last time I heard he rejects our help (Ie. Ditch the Zeta), ignores the community and works to the detriment of BYOND by bashing out another zeta rip with all the dexiterity of a lame (and blind) monkey tied to a pole.
In response to Ehlert
Ehlert wrote:
Teh Governator wrote:
Ehlert wrote:
Why does everyone make dbz games.. come on.. let your imagination run wild and make something different.. gosh.. all the dbz games are the same anyways basicly.. well the majority of them are.

Build Your Own Net Dream. 'nuf said. It's their dream, let 'em be.

lol.. still I dont think their own dream involves coding thats basicly the same in the other games..

And, how do you know what their dream is?
Page: 1 2