ID:170518
 
i am having some problems making a budokai style fighting tournament, i think i have it setup right, but i get weird errors. ive tried the best i can, now im kinda stumped, if anyone can help me, or tell me what i should/shouldnt have done that would be appreciated. here goes:


        BudoKai()

if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.contents += new/obj/verb/joinbudo()
else
for(var/mob in budo)
var/mob/M
usr.x = M.x
usr.y = M.y
usr.z = M.z


and my join verb:

obj
verb
joinbudo()
var/mob/M
usr.loc = locate(1,1,1)
M.x = usr.x
M.y = usr.y
M.z = usr.z
usr.budo = 1
mob/var
budo = 0



runtime error: cannot append to list
proc name: BudoKai (/mob/Admin/verb/BudoKai)
source file: Police.dm,1013
usr: VerM (/mob/characters/saiyajin)
src: VerM (/mob/characters/saiyajin)
call stack:
(/mob/characters/saiyajin): BudoKai()

it is weird, and when you join it tries to find a src for x. something is definately screwey here.

Um, what's the mob equal to?

Do M = usr, I think that'll work.
Don't rip zeta.
In response to Hell Ramen
Hell Ramen wrote:
Um, what's the mob equal to?

Do M = usr, I think that'll work.

i tried the M = usr and it doesnt have any call stacks, but now it doesnt start a budo, if you try to start one, it does nothing, but you can join one all day long.and Death, i think if it was zeta rip it would work properly, since its not and you blast everyone who has any kind of similairity to the zeta base, since ima see it anyway, let the blasting begin.

        BudoKai()
set category = "GM"
set desc = "Budo"
if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.contents += new /mob/verb/joinbudo()
else
for(var/mob in budo)
var/mob/M = usr
usr.x = M.x
usr.y = M.y
usr.z = M.z


mob
verb
joinbudo()
var/mob/M = usr
usr.loc = locate(77,77,1)
M.x = usr.x
M.y = usr.y
M.z = usr.z
usr.budo = 1


the minor change i seen was changing it from object to mob, it seemed to get rid of the call for the joinbudo word, but now its as if it doesnt affect whether or not a budo is going.
In response to Twizted1
        BudoKai()//-_- Is this a proc or a verb?
set category = "GM"
set desc = "Budo"
if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.contents += new /mob/verb/joinbudo()
else
for(var/mob/M in budo)
//Indentation Error'd
//I don't know if this a proc or not, but I'll pretend it's a verb.
src.x = M.x
src.y = M.y
src.z = M.z


mob
verb
joinbudo(mob/M as mob in world)
src.loc = locate(77,77,1)
M.x = src.x
M.y = src.y
M.z = src.z
src.budo++

...try that.
In response to Hell Ramen
Seeing as it says;

set category = "GM"
set desc = "Budo"

It is going to be a proc =P
In response to Hell Ramen
im sorry, i should have said verb, but to have the set cat. and desc. its easier for me to code this way, lets me know what is what, like i have other verbs with weird names, but desc. reminds me what they are. ill try this, thank you guys.
In response to Hell Ramen
now i have these errors, ive tried src.x through z, and ive tried usr.x through z.

1016:error:M.x:undefined var
1017:error:M.y:undefined var
1018:error:M.z:undefined var

for:
        BudoKai()
set category = "GM"
set desc = "Budo"
if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.contents += new /mob/verb/joinbudo()
else
for(var/mob/M in budo)
src.x = M.x
src.y = M.y
src.z = M.z
In response to Twizted1
Indentation Error. Tab the src.x - src.y in one.
        BudoKai()
set category = "GM"
set desc = "Budo"
if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.contents += new /mob/verb/joinbudo()
else
for(var/mob/M in budo)
src.x = M.x
src.y = M.y
src.z = M.z


although, i don't see what the else does personally o.0
In response to Twizted1
You didn't indent under the for(). Also, you don't need to initialize verbs, not to mention that you should be adding them to M.verbs, not M.contents. atom.contents is used to represent objects within the atom. Therefore, mob.contents is generally used to represent a mob's inventory. mob.verbs is a list of all of a mob's verbs, so if you're giving a mob a verb, you should append it to mob.verbs.

        BudoKai()

set category = "GM"
set desc = "Budo"

if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.verb += /mob/verb/joinbudo()

else
for(var/mob/M in budo)
src.loc=M.loc
In response to Wizkidd0123
Wizkidd0123 wrote:
You didn't indent under the for(). Also, you don't need to initialize verbs, not to mention that you should be adding them to M.verbs, not M.contents. atom.contents is used to represent objects within the atom. Therefore, mob.contents is generally used to represent a mob's inventory. mob.verbs is a list of all of a mob's verbs, so if you're giving a mob a verb, you should append it to mob.verbs.

>         BudoKai()
>
> set category = "GM"
> set desc = "Budo"
>
> if(!budo)
> world<<"[src] has started a Budo!"
> for(var/mob/M in world)
> M.verb += /mob/verb/joinbudo()
>
> else
> for(var/mob/M in budo)
> src.loc=M.loc
>


Wizzy, it is suppose to be:

 BudoKai()

set category = "GM"
set desc = "Budo"

if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.verbs += /mob/verb/joinbudo() // You put M.verb =P

else
for(var/mob/M in budo)
src.loc=M.loc
In response to Wizkidd0123
ahhh ok. i see what you are saying. thanks. at first i thought i did tab them in one, but after looking, i seen that i didnt. that was all my fault, but thanks again everyone.
In response to N1ghtW1ng
Thanks, Night! I didn't even realize I did that. Anyway, now that I look at it, it should be:

        BudoKai()

set category = "GM"
set desc = "Budo"

if(!budo)
world<<"[src] has started a Budo!"
for(var/mob/M in world)
M.verbs += /mob/verb/joinbudo

else
for(var/mob/M in budo)
src.loc=M.loc


I changed
M.verbs += /mob/verb/joinbudo()
into
M.verbs += /mob/verb/joinbudo