ID:147133
 
I'm having an annoying little problems. Dream Maker doesn't say there is anything wrong with the code. Its just whenever I log into the the gae the screen goes black and I get some error message. If I get rid of one of the new objects it works fine then. Its just whenever I try to add a 2nd thing to the list it messes up.

Here's a piece of the Code and it shows how I did things
mob
Login()
usr.icon='Male01.dmi'
usr.icon_state="Battle B"
usr.Stances += new/obj/Stances/Wanryoku
usr.Stances += new/obj/Stances/Ichihayaku
usr.loc=locate(25,27,1)
usr.overlays+=/obj/characterhead
var
list/Stances
list/WanCombos
list/WanTechs
list/IchiCombos
list/IchiTechs
Stat()
if(usr.inbattle == 1)
if(usr.Stance == "Wanryoku")
statpanel("~ COMBOS ~")
stat(src.WanCombos)
statpanel("~ TECHS ~")
stat(src.WanTechs)
if(usr.inbattle == 1)
if(usr.Stance == "Ichihayaku")
statpanel("~ COMBOS ~")
stat(src.IchiCombos)
statpanel("~ TECHS ~")
stat(src.IchiTechs)
if(usr.StanceChange == 1)
statpanel("~ STANCE ~")
stat(src.Stances)

obj
Stances
icon = 'Stances.dmi'
Wanryoku
icon_state = "Stance"
name = "~ Wanryoku ~"
suffix = "(1 Step)"
Click()
if(usr.Steps == 1)
usr << "Changing stance with 1 combo step left will be meaningless!"
usr.LockMovement = 0
usr.opened = 0
else if(usr.Stance == "Wanryoku")
usr << "You are already in this stance!"
usr.LockMovement = 0
usr.opened = 0
else
usr << "You changed your Stance to Wanryoku!"
usr.Steps -= 1
usr.LockMovement = 0
usr.opened = 0
usr.Wanryoku()
Ichihayaku
icon_state = "Stance"
name = "~ Ichihayaku ~"
suffix = "(1 Step)"
Click()
if(usr.Steps == 1)
usr << "Changing stance with 1 combo step left will be meaningless!"
usr.LockMovement = 0
usr.opened = 0
else if(usr.Stance == "Ichihayaku")
usr << "You are already in this stance!"
usr.LockMovement = 0
usr.opened = 0
else
usr << "You changed your Stance to Ichihayaku!"
usr.Steps -= 1
usr.LockMovement = 0
usr.opened = 0
usr.Ichihayaku()


The Login error message that I'm getting is

runtime error: type mismatch
proc name: Login (/mob/Login)
usr: Codesterz (/mob)
src: Codesterz (/mob)
call stack:
Codesterz (/mob): Login()
in dm go to build pref for games click the debuggre..that should tell u wut line and dm the error is in.
In response to CodingSkillz
doing that only pointed out the abvious for me
mob
Login()
usr.icon='Male01.dmi'
usr.icon_state="Battle B"
usr.Stances += new/obj/Stances/Wanryoku
usr.Stances += new/obj/Stances/Ichihayaku <--THE ERROR IS HERE
usr.loc=locate(25,27,1)
usr.overlays+=/obj/characterhead
var
list/Stances
list/WanCombos
list/WanTechs
list/IchiCombos
list/IchiTechs
Stat()
if(usr.inbattle == 1)
if(usr.Stance == "Wanryoku")
statpanel("~ COMBOS ~")
stat(src.WanCombos)
statpanel("~ TECHS ~")
stat(src.WanTechs)
if(usr.inbattle == 1)
if(usr.Stance == "Ichihayaku")
statpanel("~ COMBOS ~")
stat(src.IchiCombos)
statpanel("~ TECHS ~")
stat(src.IchiTechs)
if(usr.StanceChange == 1)
statpanel("~ STANCE ~")
stat(src.Stances)

obj
Stances
icon = 'Stances.dmi'
Wanryoku
icon_state = "Stance"
name = "~ Wanryoku ~"
suffix = "(1 Step)"
Click()
if(usr.Steps == 1)
usr << "Changing stance with 1 combo step left will be meaningless!"
usr.LockMovement = 0
usr.opened = 0
else if(usr.Stance == "Wanryoku")
usr << "You are already in this stance!"
usr.LockMovement = 0
usr.opened = 0
else
usr << "You changed your Stance to Wanryoku!"
usr.Steps -= 1
usr.LockMovement = 0
usr.opened = 0
usr.Wanryoku()
Ichihayaku
icon_state = "Stance"
name = "~ Ichihayaku ~"
suffix = "(1 Step)"
Click()
if(usr.Steps == 1)
usr << "Changing stance with 1 combo step left will be meaningless!"
usr.LockMovement = 0
usr.opened = 0
else if(usr.Stance == "Ichihayaku")
usr << "You are already in this stance!"
usr.LockMovement = 0
usr.opened = 0
else
usr << "You changed your Stance to Ichihayaku!"
usr.Steps -= 1
usr.LockMovement = 0
usr.opened = 0
usr.Ichihayaku()


If I get rid of the second new/obj it workd perfectelly as soon as you add a second thing to the list it bugs up
In response to Codesterz
Just a few quick things here.. You are using usr in a proc which is Stat() and you shouldnt be using usr in login.

--Goz
In response to Goz
the usr things are just temporary...

Does any1 know why its not working???? Should I can explain what the list do and are for?
Wrong:
> var
> list/Stances
> list/WanCombos
> list/WanTechs
> list/IchiCombos
> list/IchiTechs

Right:
var
list/Stances = list ()
//The rest


--Goz
In response to Goz
Thanks Goz now I can finally continue on with the battle system.
In response to Codesterz
Codesterz wrote:
Thanks Goz now I can finally continue on with the battle system.

No problem, best of luck to you!

--Goz