ID:271801
 
obj
bablast
icon = '****.dmi'
icon_state = ""
density = 1
New()
spawn(100)
del src
Bump(A)
if(ismob(A))
var/mob/M = A
if(M == src.Gowner)
del src
return
if(M.ispedal)
del src
return
var/mob/O = src.Gowner
var/damage = O.reiatsu * 3- M.reiatsu
if(damage < 1)
damage = 1
if(M.chadref)
var/K = new/obj/reflection(M.loc)
K:attack = damage
K:dir = M.dir
K:Gowner = M
walk(K,M.dir)
del src
M.overlays += '******.dmi'
M.frozen = 1
M.canattack = 0
if(M.enemy)
O.hollowprotection = 1
M.Death(O)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)

now i want to do after 50 secend the M.overlays and the M.frozen will be gone
i tryied using Spawn and sleep but its dont really work.
someone have any suggetion?
spawn(500) is what you want. Also, there's a bunch wrong there, not just the overlays. You should almost never need to use the : operator to get a variable. Use . instead. After the New() line, you need to add ..() so it actually creates the object. That might be part of your problem. You don;t need to return after del(src), since src will no longer exist after that line, and that includes this proc as well. Once you del a src, everything it was running at the time ends and goes bye-bye along with the src.

Don't forget to indent after the spawn(500), or else it won't bother waiting and just execute the following line immediately.

~X
In response to Xooxer
Xooxer wrote:
spawn(500) is what you want. Also, there's a bunch wrong there, not just the overlays. You should almost never need to use the : operator to get a variable. Use . instead. After the New() line, you need to add ..() so it actually creates the object. That might be part of your problem. You don;t need to return after del(src), since src will no longer exist after that line, and that includes this proc as well. Once you del a src, everything it was running at the time ends and goes bye-bye along with the src.

Don't forget to indent after the spawn(500), or else it won't bother waiting and just execute the following line immediately.

~X
ok i did like you said and here how it is now but still not working :S
obj
bablast
icon = 'bakudoublast.dmi'
icon_state = ""
density = 1
New...()
Bump(A)
if(ismob(A))
var/mob/M = A
if(M == src.Gowner)
del src
if(M.ispedal)
del src
var/mob/O = src.Gowner
var/damage = O.reiatsu * 3- M.reiatsu
if(damage < 1)
damage = 1
if(M.chadref)
var/K = new/obj/reflection(M.loc)
K:attack = damage
K:dir = M.dir
K:Gowner = M
walk(K,M.dir)
del src
M.overlays += 'rikujoukourou.dmi'
M.frozen = 1
M.canattack = 0
spawn(100)
M.overlays -= 'rikujoukourou.dmi'
M.frozen = 0
if(M.enemy)
O.hollowprotection = 1
M.Death(O)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)

after 10 secend the enemy still cant move and stuck with the overlays
so whats wrong on that now :S
ok i did like you said and now its
New() ..()
but still after the time i gived to the spawn the frozen dont come down adn so the overlays :<
In response to Sasuke_EX
up
In response to Sasuke_EX
Your code has some indentation problems that could be messing up the way things are executed. Remeber, if you wan to spawn() a bunch of code, that code must be indented under the spawn(), otherwise, it will just run the code immediately.
In response to Xooxer
Xooxer wrote:
Your code has some indentation problems that could be messing up the way things are executed. Remeber, if you wan to spawn() a bunch of code, that code must be indented under the spawn(), otherwise, it will just run the code immediately.


i will put here the dm code like its right now and tell me what is wrong there ok?(if there is any thing wrong)
BTW i sorry to bother but i really want to learn codin good so mabey one day i could make my own original game :<
but till then
obj
bablast
icon = 'bakudoublast.dmi'
icon_state = ""
density = 1
New() ..()
Bump(A)
if(ismob(A))
var/mob/M = A
if(M == src.Gowner)
del src
if(M.ispedal)
del src
var/mob/O = src.Gowner
var/damage = O.reiatsu * 3- M.reiatsu
if(damage < 1)
damage = 1
M.overlays += 'rikujoukourou.dmi'
M.frozen = 1
M.canattack = 0
spawn(500)
M.overlays -= 'rikujoukourou.dmi'
M.frozen = 0
M.canattack = 1
if(M.enemy)
O.hollowprotection = 1
M.Death(O)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)

now please if there is anything wrong can you fix it only by fixin the mistake on the code i will learn what wrong :S
In response to Sasuke_EX
Here, let my try and make things clearer:
obj
bablast
icon = 'bakudoublast.dmi'
icon_state = ""
density = 1

Bump(A)
if(ismob(A))
var/mob/M = A
if(M == src.Gowner)
del src

if(M.ispedal)
del src

var/mob/O = src.Gowner
var/damage = O.reiatsu * 3- M.reiatsu

if(damage < 1)
damage = 1

M.overlays += 'rikujoukourou.dmi'
M.frozen = 1
M.canattack = 0

spawn(500)
M.overlays -= 'rikujoukourou.dmi'
M.frozen = 0
M.canattack = 1

if(M.enemy)
O.hollowprotection = 1
M.Death(O)
del(src)

if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)

if(istype(A,/obj/))
del(src)


Now I can't be certain that it works as expected, since much of your code gave little indication as to how it should be indented, but I gave it a shot. This is indented properly. notice how the if() lines are indented below the if()? That's how BYOND knows what goes with what.

By indenting like that, it tells BYOND that this code belongs together, and should be executed only when if() is true. spawn() works the same way. everything you want to execute together after the spawn() ends needs to be indented under the spawn(), so BYOND can tell that the block of code is part of spawn(), and not just the next line to be executed.

Oh, I also removed the New() proc, since you're not doing anything with it. Adding ..() just tells it to do what what it normally does. You don't need to define New() unless you plan on changing how it operates. Since you're not doing that, you can leave it out and it will still do the normal action of creating a new obj.

~X
In response to Xooxer
i see :S
i guess i will give up with that since its int workin :'(
In response to Sasuke_EX
Well don't give up that easily. :P

Ok, let's try something differnt. Try adding an object instead of an icon file. I can't remember if you can add a raw icon file or not, but I know you can add an object just as easily. If it's showing the rikujoukourou icon over the mob, then this should work to get rid of it.

                var/obj/O = new()
O.icon = 'rikujoukourou.dmi'
M.overlays += O
M.frozen = 1
M.canattack = 0

spawn(500)
M.overlays -= O
M.frozen = 0
M.canattack = 1
del(O)


~X
In response to Xooxer
fixed the error
and its work good but
the icon dont put the right overlay its put my icon on the other man that the bablast hit him
and not the overlay from the icon and also after the time its dont down the overlays :S

Edit:
ok this is weird i compiled agein and did the attack agein now the overlays work good but its dont down the overlays and the frozen i mean you stuck frozen and with the overlays this is really messd up