ID:1918163
 
(See the best response by Misticone.)
Problem description:
I copy-pasted a bit of code, and changed 1 variable to assume a different property, the name of the process, and it's icon state.. Rather than working as expected, it has given me MANY errors, all of which have to do with undefined types, invalid proc definitions, and unknown variable types. In theory, this should have caused no errors, as it was a copy-paste of original code, just a tweak of some features that were meant to be tweaked. I am completely stumped, i would appreciate some insight.
1st. Did you copy ALL the original code? If you did then check the tab spacing.
2nd. If you didn't copy all the original code then there will be var/proc/etc references missing. If you don't set this var var/DiceNumber and if u write this DiceNumber = 6 you will get an error since you are making reference to a variable that doesn't exist. (Same thing happens with procs/verbs/...).
I copied every bit of code i worked on, and the tabbing was perfect. It gave me no errors during compiling until i tried compiling with the pasted code.
Give a read to your code, you may have deleted a parenthesis on accident (for example).
I read through every bit again, and i even deleted what i changed, copy-pasted the original code agian, and just changed what i changed before to make sure there were no spelling errors or anything of the such. The errors were still there after i compiled.
Could you paste the code that u copied here?
var/obj/Jutsu/Spider/explodingkunai/kunai/K=new();K.name="[src]";K.loc = locate(src.x,src.y,src.z);K.dir=src.dir;K.Owner=src;K.JutsuLevel=1
walk(K,src.dir)


this is the code that produces all the errors except for the invalid proc definition
it is because of the walk proc tabbing. Try this:
var/obj/Jutsu/Spider/explodingkunai/kunai/K=new()
K.name=src.name
K.loc = src.loc
K.dir = src.dir
K.Owner = src
K.JutsuLevel=1
walk(K,src.dir)
Thanks, you're a savior, but i have one error left, and that's: proc definition not allowed inside another proc

    Kumosenkyuu()
if(src.Kumosenkyuu)
src<<"You take back in the bow.";src.Kumosenkyuu=0;src.Frozen=0;src.Normal()
usr.overlays-= /obj/Jutsu/Spider/bow;usr.underlays-= /obj/Jutsu/Spider/bowU
return


Everything is fixed though, just that last error. I never touched this code though.
replace with this:
mob/proc
Kumosenkyuu()
if(src.Kumosenkyuu)
src<<"You take back in the bow."
src.Kumosenkyuu=0
src.Frozen=0
src.Normal()
src.overlays-= /obj/Jutsu/Spider/bow
src.underlays-= /obj/Jutsu/Spider/bowU
return

Double click the error and post here the line that appears underlined (and the one above).
mob/proc
Kumosenkyuu()
if(src.Kumosenkyuu)


I'm not sure what you mean by Normal() proc

When i inserted the coding you just gave me to replace my past code, i got 59 errors all consisting of inconsistent indentation, and a bad argument definition.
The inconsistent indentation is because of the tab spacing.
In the code that you posted there is this line
src.Normal()
, that is the normal proc I was talking about.

Fix the inconsistent indentation (with tab spaces) and then let me know if u get any errors.
I fixed all of the indentation errors, now i'm down to 2 errors.
Bump(A)
..()
var/mob/O = src.Owner

proc definition not allowed inside another proc at ..()

else
src.ChakraDrain(20000);
src<<"You harden your webbing into a bow!";

Bad argument definition at src<<
You are adding too much tab spaces. Semicolons are not required.
Bump(A)
var/mob/O = src.Owner
..()

//AND

else
src.ChakraDrain(20000)
src<<"You harden your webbing into a bow!"
The first code you gave me did not fix the "proc definition not allowed inside another proc," and adding the second code didn't fix the "bad argument definition"
mob/proc
Kumosenkyuu()
if(src.Kumosenkyuu)
src<<"You take back in the bow."
src.Kumosenkyuu=0
src.Frozen=0
src.Normal()
src.overlays-= /obj/Jutsu/Spider/bow
src.underlays-= /obj/Jutsu/Spider/bowU
return

The problem there is your if statement. Your variable name is the same as the proc name.
if(src.Kumosenkyuu)
I'm sure that's not where the error is, as the errors direct me to the previous code i gave you, and in the else statement.

else
src.ChakraDrain(20000)
//This is the bad argument definition src<<"You harden your webbing into a bow!"


var/Exploding=1
Bump(A)
//This is where the "proc definition not allowed inside another proc" is var/mob/O = src.Owner

Ok in the second code the problem is the tab spacing, put this instead:
var/Exploding=1
Bump(A)


In the first one the problem is with the src.ChakraDrain() probably. Check if you don't have a variable named ChakraDrain (if you do then you found the problem).
Thanks, that fixed it, although the first one isn't a problem with src.ChakraDrain i don't believe, because the variable ChakraDrain is used in other operations as well which don't contain errors. I believe the problem is in the src<<"You harden your webbing into a bow!," because that is where the compiler is leading me.
Best response
The compiler sometimes underlines the line under the line where the real problem is. You said that you used the ChakraDrain variable on other operations?? So it is as variable. The problem is that you are handling it as a proc by writing this ChakraDrain(20000). Just to check if I am right delete the ChakraDrain(20000) line. Still get any errors?
Page: 1 2