Commands\Dual Train\Dual Train.dm:6:error:weightgi:undefined var
Commands\Dual Train\Dual Train.dm:6:error:weightcape:undefined var
Commands\Dual Train\Dual Train.dm:6:error:weightarmor:undefined var
It shows these 3 errors and these errors only, when i double click them it goes to an irrelevant part of the code(the error it shows isnt there), all 3 errors are highlighted on the same line
ID:273120
Sep 28 2009, 6:03 pm
|
|
Sep 28 2009, 6:20 pm
|
|
Heads up, showing the code/area where the problem is occurring would be helpful for others to assist you.
|
In response to Maximus_Alex2003
|
|
mob/var/exp_bonus = 0
mob/var/dualtrain = 0 mob/learn verb Dual_Train(mob/PC/M in get_step(usr,usr.dir)) set category = "Training" usr.afk_time = 0 if(!M)return if(istype(M,/mob/PC)) if(usr.dualtrain == 1) usr << "You or your partner have stopped training" usr.doing = 0 usr.frozen = 0 usr.dualtrain = 0 usr.icon_state = "" M << "You or your partner have stopped Training" M.doing = 0 M.frozen = 0 M.dualtrain = 0 M.icon_state = "" return the error is highlighted on line 6- usr.afk_time = 0,below set category = "Training" |
In response to Super_Trooper
|
|
one more thing, whenever i change the vars or move it, it jumps to a different code, but is on the same line
|
In response to Super_Trooper
|
|
So your apparent clothing 'weightgi' and whatnot is coded wrong but it brings you to this file instead.
Have you tried looking for your weightgi/clothing and seeing if everything is proper there? |
In response to Maximus_Alex2003
|
|
i searched all "weightgi","weightcape","weightarmor" and found nothing wrong, its as if the error doesn't exist
|
In response to Super_Trooper
|
|
Sorry buddy.
I can't help you much. I've got a problem of my own I've been working on for weeks now and can't seem to perfect and polish. Hopefully someone else can come by and help you. =\ Good luck. |
In response to Super_Trooper
|
|
ok so i moved the vars, and it came up in the same spot of a different code, this is the entire code.
mob/var/money = 0 obj Zenni icon='goldpile.dmi' verb Get() set src in oview(0) usr.zenni+=amount usr<<"\blue You pick up [amount] Zenni !" del(src) var amount=0 mob/PC verb Drop_Zenni(N as num) set category = "Channels" var/a a=round(N) if(a>0) if(usr.zenni>=a) var/obj/G=new/obj/Zenni(usr.loc);G.amount=a if(a>0) G.icon_state="a" if(a>300) G.icon_state="b" if(a>600) G.icon_state="c" if(a>1500) G.icon_state="d" // if(a>390) // G.icon_state="" // if(a>550) // G.icon_state="" // if(a>980) // G.icon_state="" if(a>=10000) G.icon_state="e" usr.zenni-=a usr<<"\blue You drop [a] Zenni !" else usr<<"\red You cannot drop [a] Zenni, you only have [usr.zenni] Zenni !" else usr<<"\red You must drop a positive amount of Zenni!" the error is highlighted on Get() |
In response to Super_Trooper
|
|
You need to post lines from "Dual Train.dm"
|
In response to Chowder
|
|
sorry the errors dont have any revelance to any one code, it jumps from code to code if i change the location of the vars, but i cant find anythign wrong. I know its a minor error in DM or something cuz its obviously showing the WRONG error. I need someone to help me find what it is.
|
In response to Super_Trooper
|
|
Just post the lines from "Dual Train.dm"
|
In response to Chowder
|
|
mob/var/exp_bonus = 0
mob/var/dualtrain = 0 mob/learn verb Dual_Train(mob/PC/M in get_step(usr,usr.dir)) set category = "Training" usr.afk_time = 0 if(!M)return if(istype(M,/mob/PC)) if(usr.dualtrain == 1) usr << "You or your partner have stopped training" usr.doing = 0 usr.frozen = 0 usr.dualtrain = 0 usr.icon_state = "" M << "You or your partner have stopped Training" M.doing = 0 M.frozen = 0 M.dualtrain = 0 M.icon_state = "" return if(usr.doing == 1) return if(M.doing == 1) return if(usr.stamina <= 0 | M.stamina <= 0) usr << "You are too drained to train" M << "You are too drained to train" return if(usr.doing == 1) src << "You are already doing something" return if(M.doing == 1) src << "[M.name] is already doing something" return if(alert("Are you sure you want to dual train with [M]?","Dual Train with [M]?","Yes","No") == "Yes") switch(alert(M,"Would you like to Dual Train with [usr]?","Dual Train","Yes","No")) if("Yes") if(M in oview(4)) if(!M)return var/too_weak = M.powerlevel * 100 if(usr.powerlevel >= too_weak) usr << "[M.name] wouldn't be worth Training with" return var/too_strong = usr.powerlevel / 100 if(usr.powerlevel <= too_strong) M << "[usr.name] is far to Powerful to train with!" return if(usr.rest == 1) usr << "You stop resting" usr.rest = 0 usr.icon_state = "" usr.frozen = 0 usr.doing = 0 if(usr.fly == 1) usr << "You land on the ground from the sky" usr.fly = 0 usr.density = 1 usr.doing = 0 usr.icon_state = "" return if(M.fly == 1) M << "You land on the ground from the sky" M.fly = 0 M.density = 1 M.doing = 0 M.icon_state = "" return if(M.rest == 1) M << "You stop resting" M.rest = 0 M.icon_state = "" M.frozen = 0 M.doing = 0 usr.dualtrain = 1 usr.doing = 1 usr.icon_state = "1" usr << "You begin to Dual Train. To stop hit Dual-Train again" usr.frozen = 1 M.dualtrain = 1 M.doing = 1 M.icon_state = "1" M << "You begin to Dual Train. To stop hit Dual-Train again" M.frozen = 1 Dual_Train2(usr,M) return if("No") usr << "[M] does not want to dual train" return else usr << "You can't train with NPC's" return mob/proc/Dual_Train2(mob/U,mob/M) var/bonus_u = U.grav / 100 var/bonus_m = M.grav / 100 if(bonus_u < 10) bonus_u = 1 if(bonus_m < 10) bonus_m = 1 U.exp_bonus = ((U.level/15)-U.level/50) M.exp_bonus = ((M.level/15)-M.level/50) if(U.dualtrain == 1 && M.dualtrain == 1) if(U.stamina > 15 && M.stamina > 15) if(U.grav == 0) U.exp += U.exp_bonus else U.exp += U.exp_bonus + (bonus_u * 2) U.stamina -= rand(0,10) U.Level() if(M.grav == 0) M.exp += M.exp_bonus else M.exp += M.exp_bonus + (bonus_m * 2) M.stamina -= rand(0,10) M.Level() sleep(50) if(U&&M) Dual_Train2(U,M) return else if(U.stamina < 0) U.stamina = 0 if(M.stamina < 0) M.stamina = 0 U << "You feel weak so you stop training" U.doing = 0 U.frozen = 0 U.dualtrain = 0 U.icon_state = "" M << "You feel weak so you stop training" M.doing = 0 M.frozen = 0 M.dualtrain = 0 M.icon_state = "" return else return it USED to apear on line 6, its always the same line, but it doesnt start in this code anymore since i moved the vars, and everytiome i uncheck one of the codes it jumps to the code directly above the last it was in. |
In response to Super_Trooper
|
|
I'd probably look at the code snippets you posted if you put them between <dm> and </dm> tags, like so:
<dm> mob/verb/stuff() </dm> for:
mob/verb/stuff()
Super_Trooper wrote: i searched all "weightgi","weightcape","weightarmor" and found nothing wrong, its as if the error doesn't exist I'm hoping you didn't rip code? Your errors are that you didn't define these variables and you tried to use them. Instead of posting the lines where it says the error is, why not be smart about it? It says these variables are undefined. Why not show us the code where you defined these variables and the code where you use these variables? That's much better than saying you looked at the code for these and there was nothing wrong, then posting some unrelated code because you clicked on the error and went to line 6. |
In response to Kuraudo
|
|
mob
var weightgi = 0 weightcape = 0 weightarmor = 0 obj/Equipment Weighted_Armor name = "Weighted Armor" density = 0 var/level = 1 equiped = 0 value = 2500 anti_decay = 0 var warmor Click() if(src in usr:contents) if(usr.level >= 250) if(usr.weightarmor == 0) if(src.equiped==1) usr<<"Error: [src.name] is already equipped!" return usr.overlays += warmor usr << "You have equiped the: [src]." suffix = "(Worn)" usr.weightarmor = 1 usr.speed -= usr.speed * 0.15 src.equiped = 1 return if(usr.weightarmor == 1) if(src.equiped == 1) usr.overlays -= warmor usr << "You have unequiped the: [src]." suffix = null usr.weightarmor = 0 usr.speed = usr.speed_max src.equiped = 0 else usr<<"Error: You may only have one of: [src.name] equipped." return else usr << "You aren't strong enough to equip this item." return verb Examine() set category = null var/examine_w_armour = "<body bgcolor=#000000 text=#FFFFFF><table border=0 cellspacing=1 width=250 id=AutoNumber1 height=210><tr><td width=273 colspan=2 height=18><font face=Verdana color=#FF0000>Weighted Armour</font></td></tr><tr><td width=96 height=12><font size=1 color=red face=Verdana>Condition:</font></td><td width=170 height=12><font size=1><font face=Verdana>[condition]</font></ font><font size=1 face=Verdana> / [condition_max]</font></td></ tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Trait</font><font size=1 color=red face=Verdana>:</font></td><td width=174 height=12><font face=Verdana size=1>Training Aid (-15% Speed)</font></td></tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Owner:</font></td><td width=174 height=12><font face=Verdana size=1>[usr]</font></td></ tr><tr><td width=273 colspan=2 height=48 style=font-family: Verdana; font-size: 8pt; font-weight: bold><font face=Verdana size=1>Weighted Armour used to speed the wearers training progress by increasing their stamina through making their body heavier and weighed down.</font></td></tr></table>" usr << browse(examine_w_armour,"window=Turban;size=300x275;border=0 ;can_resize=0; can_minimize=0;") Pick_Up() set src in oview(0) set category = null if(Move(usr)) usr << "You have picked up the: [src]." usr.inven_min += 1 else usr << "You are unable to pick up the: [src]." Drop() set category = null if(src.equiped == 0) src.loc = usr.loc usr << "You have dropped the: [src]." usr.inven_min -= 1 else usr << "You are unable to drop: [src.name], it's already equipped." obj/Equipment Weighted_Cape name = "Weighted Cape" density = 0 var/level=1 equiped = 0 value = 2500 anti_decay = 0 var wcape Click() if(src in usr:contents) if(usr.level >= 250) if(usr.weightcape == 0) if(src.equiped==1) usr<<"Error: [src.name] is already equipped!" return usr.overlays += wcape usr << "You have equiped the: [src]." suffix = "(Worn)" usr.weightcape = 1 usr.speed = round(usr.speed - (usr.speed * 0.10)) src.equiped = 1 return if(usr.weightcape == 1) if(src.equiped == 1) usr.overlays -= wcape usr << "You have unequiped the: [src]." suffix = null usr.weightcape = 0 src.equiped = 0 usr.speed = usr.speed_max else usr<<"Error: You may only have one of: [src.name] equipped." return else usr << "You aren't strong enough to equip this item." return verb Examine() set category = null var/examine_w_cape = "<body bgcolor=#000000 text=#FFFFFF><table border=0 cellspacing=1 width=250 id=AutoNumber1 height=210><tr><td width=273 colspan=2 height=18><font face=Verdana color=#FF0000>Weighted Cape</font></td></tr><tr><td width=96 height=12><font size=1 color=red face=Verdana>Condition:</font></td><td width=170 height=12><font size=1><font face=Verdana>[condition]</font></ font><font size=1 face=Verdana> / [condition_max]</font></td></ tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Trait</font><font size=1 color=red face=Verdana>:</font></td><td width=174 height=12><font face=Verdana size=1>Training Aid (-15% Speed)</font></td></tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Owner:</font></td><td width=174 height=12><font face=Verdana size=1>[usr]</font></td></ tr><tr><td width=273 colspan=2 height=48 style=font-family: Verdana; font-size: 8pt; font-weight: bold><font face=Verdana size=1>Weighted Cape used to speed the wearers training progress by increasing their stamina through making their body heavier and weighed down.</font></td></tr></table>" usr << browse(examine_w_cape,"window=Turban;size=300x275;border=0;c an_resize=0; can_minimize=0;") Pick_Up() set src in oview(0) set category = null if(Move(usr)) usr << "You have picked up the: [src]." usr.inven_min += 1 else usr << "You are unable to pick up the: [src]." Drop() set category = null if(src.equiped == 0) src.loc = usr.loc usr << "You have dropped the: [src]." usr.inven_min -= 1 else usr << "You are unable to drop: [src.name], it's already equipped." obj/Equipment Weighted_Gi name = "Weighted Gi" density = 0 var/level=1 equiped = 0 value = 2500 anti_decay = 0 var wgi Click() if(src in usr:contents) if(usr.level >= 250) if(usr.weightgi == 0) if(src.equiped==1) usr<<"Error: [src.name] is already equipped!" return usr.overlays += wgi usr << "You have equiped the: [src]." suffix = "{Worn}" usr.weightgi = 1 usr.speed = round(usr.speed - (usr.speed * 0.10)) src.equiped = 1 return if(usr.weightgi == 1) if(src.equiped == 1) usr.overlays -= wgi usr << "You have unequiped the: [src]." suffix = null usr.weightgi = 0 src.equiped = 0 usr.speed = usr.speed_max else usr<<"Error: You may only have one of: [src.name] equipped." return else usr << "You aren't strong enough to equip this item." return verb Examine() set category = null var/examine_w_gi = "<body bgcolor=#000000 text=#FFFFFF><table border=0 cellspacing=1 width=250 id=AutoNumber1 height=210><tr><td width=273 colspan=2 height=18><font face=Verdana color=#FF0000>Weighted Gi</font></td></tr><tr><td width=96 height=12><font size=1 color=red face=Verdana>Condition:</font></td><td width=170 height=12><font size=1><font face=Verdana>[condition]</font></ font><font size=1 face=Verdana> / [condition_max]</font></td></ tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Trait</font><font size=1 color=red face=Verdana>:</font></td><td width=174 height=12><font face=Verdana size=1>Training Aid (-15% Speed)</font></td></tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Owner:</font></td><td width=174 height=12><font face=Verdana size=1>[usr]</font></td></ tr><tr><td width=273 colspan=2 height=48 style=font-family: Verdana; font-size: 8pt; font-weight: bold><font face=Verdana size=1>Weighted Gi used to speed the wearers training progress by increasing their stamina through making their body heavier and weighed down.</font></td></tr></table>" usr << browse(examine_w_gi,"window=Turban;size=300x275;border=0;can _resize=0; can_minimize=0;") Pick_Up() set src in oview(0) set category = null if(Move(usr)) usr << "You have picked up the: [src]." usr.inven_min += 1 else usr << "You are unable to pick up the: [src]." Drop() set category = null if(src.equiped == 0) src.loc = usr.loc usr << "You have dropped the: [src]." usr.inven_min -= 1 else usr << "You are unable to drop: [src.name], it's already equipped." mob proc Gravity_Strain() if(src.grav != 0) var/success = rand(1,6) var/expgain=(grav/10) var/bonus=((weightarmor*3+weightgi*3+weightcape*3)+1) expgain*=bonus if(prob(5)) src.stamina -= rand(2,3) if(success == 1 || success == 2 || success == 5) src.powerlevel -= expgain * (rand(5000,25000)) src.exp += expgain * rand(1,2) src.stm_exp += 5 src.Endurance_lvlup() if(success == 3) src.powerlevel -= expgain * (rand(20000,100000)) src.exp += expgain * rand(3,5) src.stm_exp += 10 src.Endurance_lvlup() if(success == 4 || success == 6) src.powerlevel -= expgain * (rand(10000,50000)) src.exp += expgain * rand(2,4) src.stm_exp += 7 src.Endurance_lvlup() if(src.powerlevel <= 0) src.Gravity_Die() src.grav = 0 if(src.powerlevel >= 1) src.Level() spawn(40) if(src.grav == 0) src.powerlevel += 0 else src.Gravity_Strain() mob/var/HBTC = 0 turf/Gravity/ HBTC_Gravity Enter(mob/PC/M) if(M.powerlevel >= 0) M.exp += round(5*(rand(1,5)+(weightgi*2+weightcape*2+weightarmor*2)+1)) M.stm_exp += rand(1,2) M.Endurance_lvlup() M.powerlevel -= (rand(50000, 100000)) M.Level() M.HBTC_DIE() return 1 turf/Planet_Gravitys Supreme_Kai Enter() usr.Level() var/random = rand(1,10) var/bonus=((usr.weightarmor*3+usr.weightgi*3+usr.weightcape* 3)+1) if(usr.powerlevel_max >= 3500000) if(random == 4) usr.exp += (10 * bonus) if(usr.powerlevel_max >= 1500000 && usr.powerlevel_max <= 3500000) random = rand(1,10) if(random == 1 || random == 2 || random == 7) usr.powerlevel -= (bonus * rand(100,1000)) usr.exp += rand(bonus * rand(5,10)) usr.stamina -= (rand(3,5)) usr.KO() usr.TRANS_KO() if(usr.powerlevel_max >= 250000 && usr.powerlevel_max <= 1500000) random = rand(1,10) if(random == 1 || random == 10 || random == 3) usr.powerlevel -= (rand(25,250) * bonus) usr.exp += (rand(8,12) * bonus) usr.stamina -= (rand(4,8)) usr.KO() usr.TRANS_KO() if(usr.powerlevel_max <= 250000) random = rand(1,10) if(random == 1 || random == 6) usr.powerlevel -= (rand(0,3)) usr.stamina -= rand(5,8) usr.KO() usr.TRANS_KO() if(random == 2 || random == 7 || random == 9) usr.powerlevel -= (rand(75,250)) usr.stamina -= rand(5,10) usr.exp += (rand(25,50)) usr.KO() usr.TRANS_KO() return 1 mob/var/frozen = 0 mob/var/speeding = 0 mob/var/stm_exp = 0 mob/var/stm_tnl = 50 mob/PC Move() if(src.stamina <= 0) if(src.weightgi == 1 || src.weightcape == 1 || src.weightarmor == 1) src.KO() else src << "You are too exhausted to move" return if(src.frozen == 1) return else if(src.speeding <= 0) src.afk_time = 0 src.speeding = 1 ..() if(src.fly == 1) sleep(1) src.speeding = 0 else if(src.speed <= 10000) sleep(4) if(weightgi == 1 || weightcape == 1 || weightarmor == 1) src.speeding = 0 src.exp += ((weightgi*3+weightcape*3+weightarmor*3) * rand(3,5)) src.stm_exp += 1 src.stamina -= rand(2,5) if(src.stm_exp >= stm_tnl) src.Endurance_lvlup() src.Level() else src.speeding = 0 if(src.speed >= 10000 && src.speed <= 50000) sleep(3) if(weightgi == 1 || weightcape == 1 || weightarmor == 1) src.speeding = 0 src.exp += ((weightgi*3+weightcape*3+weightarmor*3) * rand(3,5)) src.stm_exp += 1 src.stamina -= rand(2,5) if(src.stm_exp >= stm_tnl) src.Endurance_lvlup() src.Level() else src.speeding = 0 if(src.speed >= 50000 && src.speed <= 250000) sleep(2) if(weightgi == 1 || weightcape == 1 || weightarmor == 1) src.speeding = 0 src.exp += ((weightgi*3+weightcape*3+weightarmor*3) * rand(3,5)) src.stm_exp += 1 src.stamina -= rand(2,5) if(src.stm_exp >= stm_tnl) src.Endurance_lvlup() src.Level() else src.speeding = 0 if(src.speed >= 250000) sleep(1.5) if(weightgi == 1 || weightcape == 1 || weightarmor == 1) src.speeding = 0 src.exp += ((weightgi*3+weightcape*3+weightarmor*3) * rand(3,5)) src.stm_exp += 1 src.stamina -= rand(2,5) if(src.stm_exp >= stm_tnl) src.Endurance_lvlup() src.Level() else src.speeding = 0 else return var/expgain = (round(rand(10,25))+(src.level/30)) ((grav+1)/150)+(((weightarmor*3+weightgi*3+weightcape*3)+1)/ 15) if(grav||weightarmor||weightgi||weightcape)expgain=round(exp gain*(1+bonus)) exp+=expgain |
In response to Kuraudo
|
|
Considering the code he's been posting - it's safe to say it's ripped.
|
I'm pretty sure you have to define the variables. If it's going into something as an empty space then you did an error somewhere else that's affecting the rest of your little source code.
|
In response to Super_Trooper
|
|
Please re-read the first half of my post. I'm not looking at your code like that.
|