ID:147720
 
OK, so Im working on Kamehameha, and I got most of it to work very well.

What I want to do now, is make it so it appears as if the wave is streaching out, instead of shooting like a missel.

missile(/obj/techs/Kame_Head, usr, M.loc)

Above is the missle proc that creates the kamehameha head that will fly tward the M.target.

Then:

/obj/techs/Kame_Head
icon = 'wave.dmi'
icon_state = "head"
density = 1
New(Move())
var/obj/techs/Kame_Tail/O=new
O.loc = src.loc

Above is the Kamehamahe head that should fly twards the M. target. As you can see, I tried to make it, so when it is created, and when it moves, it makes a tail, and drops it behind it.

Then:

/obj/techs/Kame_Tail
icon = 'wave.dmi'
icon_state = "trail"
density = 0
New()
sleep(2)
del(src)

This is the tail I was talking about. When a new tail is made, it waits a few seconds then del()s itself.

I hope this isn't confusing so far..

Anyways, the head appears just fine and works, but, the tail wont show up. Any suggestions or ideas?
You've got a sleep(2) there, thats not exactly the few seconds you mentioned, that might be the problem, I'll look at it a little closer though.
In response to Jotdaniel
I dont think thats it, cause I cranked up the sleep on the tail to sleep(10) and still got nothing.
In response to Shades
var/obj/O = new/obj/kibeams/tail(src.loc)
O.dir = src.dir
step(src,src.dir)



I cut that out of one of my old procs, see how it works for you, using a similar method.
In response to Jotdaniel
This is how the new code looks like, still no good:


/obj/techs/Kame_Head
icon = 'wave.dmi'
icon_state = "head"
density = 1
New(Move())
var/obj/O = new/obj/techs/Kame_Tail(src.loc)
O.dir = src.dir
step(src,src.dir)


/obj/techs/Kame_Tail
icon = 'wave.dmi'
icon_state = "trail"
density = 0
New()
sleep(2)
del(src)
In response to Shades
Shades wrote:
This is how the new code looks like, still no good:

> /obj/techs/Kame_Head
> icon = 'wave.dmi'
> icon_state = "head"
> density = 1
> New()
> var/obj/O = new/obj/techs/Kame_Tail(src.loc)
> O.dir = src.dir
> step(src,src.dir)
>
>
> /obj/techs/Kame_Tail
> icon = 'wave.dmi'
> icon_state = "trail"
> density = 0
> New()
> ..() // here is your problem, you werent letting it create the object before deleteing it
> spawn(20) del(src)

In response to Jotdaniel
/obj/techs/Kame_Head
icon = 'wave.dmi'
icon_state = "head"
density = 1
New()
var/obj/O = new/obj/techs/Kame_Tail(src.loc)
O.dir = src.dir
step(src,src.dir)


/obj/techs/Kame_Tail
icon = 'wave.dmi'
icon_state = "trail"
density = 0
New()
..()
spawn(20) del(src)
/>>

Hmm, no good still. Im gonna look around the hub for a demo or lib..

In response to Shades
Shades wrote:
> >>/obj/techs/Kame_Head
> icon = 'wave.dmi'
> icon_state = "head"
> density = 1
> New()
..()//I forgot to add it here to, because of the way your calling this you need to let it do all the default stuff for both obj's
> var/obj/O = new/obj/techs/Kame_Tail(src.loc)
> O.dir = src.dir
> step(src,src.dir)
>
>
> /obj/techs/Kame_Tail
> icon = 'wave.dmi'
> icon_state = "trail"
> density = 0
> New()
> ..()
> spawn(20) del(src)
> />>
>
> Hmm, no good still. Im gonna look around the hub for a demo or lib..
>
>
In response to Jotdaniel
/obj/techs/Kame_Head
icon = 'wave.dmi'
icon_state = "head"
density = 1
New()
Wander()
Move()
var/obj/O = new/obj/techs/Kame_Tail(src.loc)
O.dir = src.dir
proc/Wander()
step(src,src.dir)
Wander()


/obj/techs/Kame_Tail
icon = 'wave.dmi'
icon_state = "trail"
density = 0
New()
sleep(8)
del(src)
In response to PBYOND
>/obj/techs/Kame_Head
icon = 'wave.dmi'
icon_state = "head"
New()
..()
var/obj/O = new/obj/techs/Kame_Tail(src.loc)
O.dir = src.dir
step(src,src.dir)


/obj/techs/Kame_Tail
icon = 'wave.dmi'
icon_state = "trail"
density = 0
New()
..()
spawn(20) del(src)

No good still. The head is still only appearing. I checked the names and stuff to make sure I didn't misname it, cause, you never know, right? Anyways, I tried both ways, and its still not working right. Thanks for all the help.

EDIT:Oh crap, wait, Im using missel to send the head off with the main code, would that cause this not to work? Just thought of it.

In response to Shades
Yes.
In response to Garthor
Thanks, so how would I fix it?
In response to Shades
Also, missile() if you read in the "F1" help, it tells you that it's purely graphical. So, if you're counting on including a Bump() with the head, better find some other means.
In response to Goku72
It all works fine, except for the streching part, and thats all I want right now is to get it to leave a trail.
In response to Shades
Garthor's code loops repeatedly to make the trail appear. Yours doesn't. Therefore, only one trail object will appear, and it probably happens so fast you don't get to notice it.
In response to Crispy
Wait, I have a code?
In response to Crispy
Thats what i was forgetting, the loop, stupid me. It was late...
Revised Code:

/obj/techs/Kame_Wave
var/firing = 0
var/dam = 10
verb
Kamehameha(mob/M in oview(15))
set category = "Techniques"

if(firing == 0)
if(M.dead == 0)
if(usr.dead == 0)
if(usr.monkey == 0)
if(usr.tech_lock == 0)
if(usr.combat_lock == 0)
if(usr.ki >= 20)
firing = 1
var/damage = input ("How much do you wish to pump into Kamehameha?") as num | null

if(damage <= 0)
firing = 0
return

else
if(damage >= usr.pl)
usr << "
You can't put that much power in your Wave!"
return
else
usr.pl -= damage
damage *= dam
view() << "[usr.name]: Kame.."
sleep(5)
view() << "
[usr.name]: Hame.."
sleep(5)
view() << "[usr.name:] HA...!"

if(M.z == usr.z)

usr.ki -= 20
M.def -= damage
M.ki_def -= damage
var/obj/techs/Kame_Head/O=new
walk(O,M.dir)
M.pl -= damage
s_damage(M,damage,"red")
M.DEATH()
firing = 0

else

usr << "
[M.name] is no longer in your sight!"
firing = 0
return












/obj/techs/Kame_Head
icon = 'wave.dmi'
icon_state = "head"
New()
..()
var/obj/O = new/obj/techs/Kame_Tail(src.loc)
O.dir = src.dir
step(src,src.dir)


/obj/techs/Kame_Tail
icon = 'wave.dmi'
icon_state = "trail"
density = 0
New()
..()
spawn(20) del(src)
<\B>


I revised my code, but for some reason now, you cant see the head nor the tail. So any sugegstions? Thanks.


In response to Shades
Well duh you can't see it, it's loc is null!
In response to Garthor
Yeh I added this var for under the head var:

O.loc = usr.loc

Now the head appears again, but its still not making the tail. Im getting so frustrated. Please help if you can. :(
Page: 1 2