ID:269911
 
        
if(usr.Custom >= 50)
set category = "Fight"
var/temp = usr.icon // hold the icon in a variable
usr.icon = 'bass_summ.dmi'
spawn(15)
view(5)<<"<font color = brown><BIG>[usr] : Multi Gun!!!! </BIG></font>"
var/W = list(mob in oview(3))
var/Y = list(mob in oview(2))
var/Z = list(mob in oview(1))
M.overlays += bshot
sleep(1)
W.overlays += bshot
sleep(1)
Y.overlays += bshot
sleep(1)
Z.overlays += bshot
sleep(1)
M.HP -= 220
sleep(1)
W.HP -= 220
sleep(1)
Y.HP -= 220
sleep(1)
Z.HP -= 220
sleep(3)
m.overlays += bshot
sleep(1)
w.overlays += bshot
sleep(1)
y.overlays += bshot
sleep(1)
z.overlays += bshot
sleep(1)
usr.icon = temp // revert the icon back
else
usr << "You Dont Have Enough Custom!"



i want to know whats wrong with this?
It helps to give the error report, and more code. For example, I can't tell if the uses of usr are valid or not, given only if() statements. Also, if it's a verb(suggested by the set category), I'd like to point out that set category goes right at the beginning of the definition, not in the middle.

Hiead
In response to Hiead
Hiead wrote:
It helps to give the error report, and more code. For example, I can't tell if the uses of usr are valid or not, given only if() statements. Also, if it's a verb(suggested by the set category), I'd like to point out that set category goes right at the beginning of the definition, not in the middle.

Hiead

this is the errors messages


loading simple.dme
sdfsd.dm:39:error:bust1 :duplicate definition
SkillGain.dm:4:error:bust1 :previous definition
sdfsd.dm:40:error:bust2 :duplicate definition
SkillGain.dm:5:error:bust2 :previous definition
sdfsd.dm:41:error:bust3 :duplicate definition
SkillGain.dm:6:error:bust3 :previous definition
sdfsd.dm:42:error:bust4 :duplicate definition
SkillGain.dm:7:error:bust4 :previous definition
SkillGain.dm:425:error:bust1:undefined var
SkillGain.dm:427:error:bust1:undefined var
SkillGain.dm:445:error:mob:undefined var
SkillGain.dm:446:error:mob:undefined var
SkillGain.dm:447:error:mob:undefined var
SkillGain.dm:448:error:M.overlays:undefined var
SkillGain.dm:448:error:bust1:undefined var
SkillGain.dm:450:error:bust1:undefined var
SkillGain.dm:452:error:bust1:undefined var
SkillGain.dm:454:error:bust1:undefined var
SkillGain.dm:456:error:M.HP:undefined var
SkillGain.dm:464:error:M.overlays:undefined var
SkillGain.dm:464:error:bust1:undefined var
SkillGain.dm:466:error:bust1:undefined var
SkillGain.dm:468:error:bust1:undefined var
SkillGain.dm:470:error:bust1:undefined var
SkillGain.dm:497:error:m.overlays:undefined var
SkillGain.dm:497:error:bust1:undefined var
SkillGain.dm:499:error:m.overlays:undefined var
SkillGain.dm:499:error:bust1:undefined var
SkillGain.dm:500:error:m.HP:undefined var
SkillGain.dm:569:error:mob:undefined var
SkillGain.dm:570:error:mob:undefined var
SkillGain.dm:571:error:mob:undefined var
SkillGain.dm:572:error:bshot:undefined var
SkillGain.dm:574:error:W.overlays:undefined var
SkillGain.dm:574:error:bshot:undefined var
SkillGain.dm:576:error:Y.overlays:undefined var
SkillGain.dm:576:error:bshot:undefined var
SkillGain.dm:578:error:Z.overlays:undefined var
SkillGain.dm:578:error:bshot:undefined var
SkillGain.dm:582:error:W.HP:undefined var
SkillGain.dm:584:error:Y.HP:undefined var
SkillGain.dm:586:error:Z.HP:undefined var
SkillGain.dm:588:error:m.overlays:undefined var
SkillGain.dm:588:error:bshot:undefined var
SkillGain.dm:590:error:w.overlays:undefined var
SkillGain.dm:590:error:bshot:undefined var
SkillGain.dm:592:error:y.overlays:undefined var
SkillGain.dm:592:error:bshot:undefined var
SkillGain.dm:594:error:z.overlays:undefined var
SkillGain.dm:594:error:bshot:undefined var
SkillGain.dm:569:W :warning: variable defined but not used
SkillGain.dm:570:Y :warning: variable defined but not used
SkillGain.dm:571:Z :warning: variable defined but not used
SkillGain.dm:445:error:W: compile failed (possible infinite cross-reference loop)
SkillGain.dm:446:error:Y: compile failed (possible infinite cross-reference loop)
SkillGain.dm:447:error:Z: compile failed (possible infinite cross-reference loop)
SkillGain.dm:450:error:W.overlays: compile failed (possible infinite cross-reference loop)
SkillGain.dm:452:error:Y.overlays: compile failed (possible infinite cross-reference loop)
SkillGain.dm:454:error:Z.overlays: compile failed (possible infinite cross-reference loop)
SkillGain.dm:458:error:W.HP: compile failed (possible infinite cross-reference loop)
SkillGain.dm:460:error:Y.HP: compile failed (possible infinite cross-reference loop)
SkillGain.dm:462:error:Z.HP: compile failed (possible infinite cross-reference loop)
SkillGain.dm:466:error:W.overlays: compile failed (possible infinite cross-reference loop)
SkillGain.dm:468:error:Y.overlays: compile failed (possible infinite cross-reference loop)
SkillGain.dm:470:error:Z.overlays: compile failed (possible infinite cross-reference loop)

simple.dmb - 62 errors, 3 warnings (double-click on an error to jump to it)
In response to Pharaoh Atem
Hiead wrote:
It helps to give the error report, and more code.

If you even look at the code you provided, you should notice a few things:

- You never defined the M var

- Variables are case sensitive!
var/Z
z.overlays += 'icon.dmi'
WON'T work! (For more than one reason)

- When dealing with variables as references, be sure to give the variable a type:
var/mob/Z = locate(mob in oview(5))
Z.overlays += 'icon.dmi'


- <_< W.overlays....but you defined W to be a list...maybe you meant to use locate() rather than list()?

- Eh, you just started assigning things to equal nonexistant variables.
M.overlays += bshot // Where did you ever define bshot?


I could go on, but it'd be a waste of time. Especially because, if you don't learn to read error reports, you'll end up coming back here with every error you come across. There's a really useful error report guide for newbies at this Bwicki page. If you learn to read error reports effectively, you may never have to ask others to solve your problems again!
Example analysis:
SkillGain.dm:448:error:M.overlays:undefined var
- The reference made by M doesn't have a variable "overlays"

Try reading through the DM Guide. DON'T SKIP ANY PART OF IT, as all of it is useful at some point. If you're one of those people that look at the guide and say "Nope, it's too long. I'll just try on my own," then I don't find you very fit to be a programmer. After all, there is no laziness in effective programming.

Good luck(please, no slacking)!

Hiead
In response to Hiead
Hiead wrote:
Hiead wrote:
It helps to give the error report, and more code.

If you even look at the code you provided, you should notice a few things:

- You never defined the M var

- Variables are case sensitive!
var/Z
> z.overlays += 'icon.dmi'
WON'T work! (For more than one reason)
- When dealing with variables as references, be sure to give the variable a type:
var/mob/Z = locate(mob in oview(5))
> Z.overlays += 'icon.dmi'

- <_< W.overlays....but you defined W to be a list...maybe you meant to use locate() rather than list()?

- Eh, you just started assigning things to equal nonexistant variables.
M.overlays += bshot // Where did you ever define bshot?

I could go on, but it'd be a waste of time. Especially because, if you don't learn to read error reports, you'll end up coming back here with every error you come across. There's a really useful error report guide for newbies at this Bwicki page. If you learn to read error reports effectively, you may never have to ask others to solve your problems again!
Example analysis:
SkillGain.dm:448:error:M.overlays:undefined var
- The reference made by M doesn't have a variable "overlays"

Try reading through the DM Guide. DON'T SKIP ANY PART OF IT, as all of it is useful at some point. If you're one of those people that look at the guide and say "Nope, it's too long. I'll just try on my own," then I don't find you very fit to be a programmer. After all, there is no laziness in effective programming.

Good luck(please, no slacking)!

Hiead



THANK YOU VERY MUCH!!!!!!!
the bshot is defined in other DM file
In response to Pharaoh Atem
Just for future reference, please don't quote really long posts, it wastes forum space.
In response to Hiead
- When dealing with variables as references, be sure to give the variable a type:
var/mob/Z = locate(mob in oview(5))
> Z.overlays += 'icon.dmi'


Look at the code that i used with the help
        Summon_Bass(mob/M in oview(2))
if(usr.Custom >= 200)
var/bshot = 'bshot.dmi'
var/mob/W = locate(/mob in oview(3))
var/mob/Y = locate(/mob in oview(2))
var/mob/Z = locate(/mob in oview(1))
set category = "Fight"
var/temp = usr.icon // hold the icon in a variable
usr.icon = 'bass_summ.dmi'
spawn(15)
view(5)<<"<font color = brown><BIG>[usr] : Multi Gun!!!! </BIG></font>"
M.overlays += bshot
W.overlays += bshot
Y.overlays += bshot
Z.overlays += bshot
M.HP -= 220
W.HP -= 220
Y.HP -= 220
Z.HP -= 220
M.overlays -= bshot
W.overlays -= bshot
Y.overlays -= bshot
Z.overlays -= bshot
spawn(5)
usr.icon = temp // revert the icon back
usr.Custom -= 200
else
usr << "You Dont Have Enough Custom!"


error when i used:




runtime error: Cannot read null.overlays
proc name: Summon Bass (/obj/Bass_Summon_chip/verb/Summon_Bass)
source file: SkillGain.dm,622
usr: Pharaoh Atem (/mob/Player)
src: Bass Summon chip (/obj/Bass_Summon_chip)
call stack:
Bass Summon chip (/obj/Bass_Summon_chip): Summon Bass(Chaos License Quest (/mob/NPC/Chaos_License_Quest))
Pharaoh Atem : Multi Gun!!!!


help plz!!!

i arent too good in english, im br!
In response to Pharaoh Atem
Why are there 3 vars for oview()? You're doing it wrong, anyways. It should be var/mob/M=locate(/mob)in oview(3).
And your font tag is bad, never put a space between the value and the attribute.
In response to Artemio
Artemio wrote:
It should be var/mob/M=locate(/mob)in oview(3).

xD That was my fault. I wasn't thinking when I posted that, and just followed the example of the person I was trying to help. My bad. =D

Hiead