ID:178484
 
im trying to creat a battle proc but I cant seem to figure out how to initiate the object I want to use as my projectile. could anyone give me an I deah on how to do this or where I can find the info.

thanks :)
Treasurecat wrote:
im trying to creat a battle proc but I cant seem to figure out how to initiate the object I want to use as my projectile. could anyone give me an I deah on how to do this or where I can find the info.

thanks :)


mob/romulan

icon = 'person.dmi'
icon_state = "romulan"
cl = -1
hp = 5
verb
fire_phaser(mob/M in view(5))
set src in view(5)
src.hp -= rand(3,5)


what I want is an object to appear (i.e. the phaser blast) and move to the src.

now I realize that moving the new object to the src is another problem but I still cant even figure out how to make the new object appear when this verb is called up.

please help
In response to Treasurecat
so far ive got this

Fire_Phaser(mob/NPC/M as mob in oview(2))
var/obj/phaser
phaser = new /obj/projectile
phaser.loc = src.loc

but im getting these errors

startrekfed.dm:168:error:/obj/projectile:undefined type path
startrekfed.dm:169:error:src.loc:undefined var
startrekfed.dm:166:error:Fire_Phaser :undefined proc


im not able to comprehend how to creat this new obj

In response to Treasurecat
<code> Fire_Phaser(mob/NPC/M as mob in oview(2)) var/obj/phaser phaser = new /obj/projectile phaser.loc = src.loc </code>

Into...

<code> Fire_Phaser(mob/NPC/M as mob in oview(2)) var/obj/A A = new /obj/phaser A.loc = src.loc while(A) if(M in range(A, 1)) del(A) M.HP-=30 M.Deathcheck() // Optional :) break if(M in oview(2)) step_towards(A, M) sleep(1) else del(A) </code>

That should do it. And if it doesn't, then it's not my fault. Only my 2nd week on BYOND. ;)

Good luck.

(Gah, why are my tabs so big? O.O)
In response to Malver
ok Im still trying to undestand this

Fire_Phaser(mob/NPC/M as mob in view(5))
var/obj/A
A = new /obj/projectile
A.loc = src.loc
while(A)
if(M in range(A, 1))
del (A)

if(M in view(5))
step_towards(A, M)
sleep(1)
else
del (A)

startrekfed.dm:168:error:/obj/projectile:undefined type path
startrekfed.dm:169:error:src.loc:undefined var
startrekfed.dm:171:error:M:undefined type: M
startrekfed.dm:174:error:M:undefined type: M
startrekfed.dm:175:error:M:undefined type: M
startrekfed.dm:166:error:Fire_Phaser :undefined proc

I have no idea why I got any of those errors I dfined M as npc mob
In response to Treasurecat
Treasurecat wrote:
ok Im still trying to undestand this

Fire_Phaser(mob/NPC/M as mob in view(5))
var/obj/A
A = new /obj/projectile
A.loc = src.loc
while(A)
if(M in range(A, 1))
del (A)

if(M in view(5))
step_towards(A, M)
sleep(1)
else
del (A)

startrekfed.dm:168:error:/obj/projectile:undefined type path
startrekfed.dm:169:error:src.loc:undefined var
startrekfed.dm:171:error:M:undefined type: M
startrekfed.dm:174:error:M:undefined type: M
startrekfed.dm:175:error:M:undefined type: M
startrekfed.dm:166:error:Fire_Phaser :undefined proc

I have no idea why I got any of those errors I dfined M as npc mob

For error #1: Change src.loc to usr.loc

For error #2-#4: Modify the pathway. If you don't wish to, make sure your mob defs look like this:

<code> mob NPC klingon etc... </code>

For Error #5: Remember to make it a verb.

<code> mob verb Fire_Phaser(etc, etc) </code>

Hope that helps.


In response to Malver
ok I know a little time has passed but I finally was able to start working on this again today. I think most of this is working it was just this part of the reply that I didnt understand

For error #2-#4: Modify the pathway. If you don't wish to, make sure your mob defs look like this:


mob
NPC
klingon
etc...
heres what ive got

//projectile


mob/verb/Fire_Phaser(mob/NPC/M as mob in view(5))
var/obj/A
A = new /obj/projectile
A.loc = usr.loc
while(A)
if(M in range(A, 1))
del (A)

if(M in view(5))
step_towards(A, M)
sleep(1)
else
del (A)

startrekfed.dm:170:error:/obj/projectile:undefined type path
startrekfed.dm:173:error:M:undefined type: M
startrekfed.dm:176:error:M:undefined type: M
startrekfed.dm:177:error:M:undefined type: M

of course what I want to do is have an object appear when I use verb fire_phaser at the users loc and travel to the target.

thanks
In response to Treasurecat
please someone help
In response to Treasurecat
If you mean projectile you would want something like the missile proc but you would need an obj made already like this.

obj/missile
icon='missile.dmi'
mob/verb/Attack(mob/M as mob in oview())
missile(/obj/missile,src,M.loc)

That would be what you need:)
In response to Super16
I tried that and it goes in with no errors and it creates an attack verb however after you select your target nothing happens what im trying to get to happen is an object to appear at the usrers loc and travel to the npc then disapear damage will be handled on another level not whether the obj hits the npc