ID:157774
 
//Fireball
mob
verb
new Fireball(usr.loc)//create fireball at users location
Move(North)//move north

if Bump(mob/M)//if it bumps a mob
del Fireball//delete


obj
Fireball
icon = 'Fireball.dmi'
icon_state = "small_fireball"


this projectile is supposed to mvoe north and if it hits a mob it deletes, is this the proper way of doing this
No. Throwing random stuff at the compiler is not going to produce working code. You need to start here.
In response to Garthor
that wasn't throwing in random stuff I was refrencing the guide, i realize the stupid mistake I made of not defining a name for the verb though, so i probably deserve being told that

ugh also realized to not check the box off to be compiled =_=..... im being stupid lol but i have read entire guide nontheless
In response to Darkjohn66
I honestly don't know how you could have produced that while referencing the Guide.
i dunno...

//Fireball
mob
verb
Fireball()
new Fireball(loc = locate(usr))//create fireball at users location
Move(North)//move north




obj
Fireball
icon = 'fireball.dmi'
icon_state = "small_fireball"

Projectile.dm:5:error: Fireball: undefined var
Projectile.dm:6:error: North: undefined var
Projectile.dm:6:warning: : operation has no effect here
In response to Darkjohn66
You did not read the guide.

First of all, your code lacks the the basis, parents and childs

mob
verb
Fireball()
new Fireball(loc = locate(usr)) // Uh? Wth is fireball? A turf perhaps? You didn't tell the compiler, how can he know?
Move(North) // Do you even know what Move does?

obj
Fireball
icon = 'fireball.dmi'
icon_state = "small_fireball" //Wold be Ok if it wasnt for the fact that you stated this was suppose to be a projectile :/


I could fix this all and give it to you, but then you would come back in 5min and ask something else

So get back to the guide and read it, but read it for real
In response to Abrax
I just wanted to see how to make a simple projectile seeing as there is no simple example explaining how it would work but I got yelled at saying I didn't read the guide

This is the How to section not design philosophy
In response to Darkjohn66
Because you don't grasp any fundamentals, nobody is going to be able to tell you how to do what you want. The best somebody could do is just spoon-feed you code, which very quickly gets obnoxious as people repeatedly come back demanding for people to write their games for them.

The Guide doesn't have a chapter named "HOW 2 MAEK PRUJ... BULLITS", but if you actually read and understand it, you should know everything you'd need to write it yourself.
In response to Garthor
Bump, still having trouble with this, please help.
In response to Darkjohn66
Have you bothered to thoroughly read the Guide and pursue other learning resources?
In response to Garthor
Other resources contain unorganized code and the work which actually goes into the projectile is spread out throughout the code from what i have seen on tutorials. 0.o. Please i just wish for help.

I won't come back asking to be spoonfed code, I get a lot of things like how skin works and how to set up macros on a hud, how stamina and mana work, how to set up safe zones, etc. I really just dont get this 0.o
You tried and that's a lot more then quite a few people around here could claim...
mob
verb
Fire()//This is the name of the verb.
var/obj/Fireball/Fb= new(loc) //Makes the Fb variable a fireball
walk(Fb,dir,1)//Walk north forever little one...
obj/Fireball
icon = 'misc.dmi'
icon_state = "small_fireball"
density=1
Move()//Bumps nice and all but it can't handle the void
. = ..()//Set the return of the parent proc to the return
var/atom/N=get_step(src,dir)//Get the next step
if(!N||!.)//If there is no next step or the parent proc returned 0
sleep(1)//Wait a sec
for(var/mob/M in N)//Loop threw the mobs on the tile
world<<"[M] was hit"
del src//Remove the ball
In response to Chowder
That's rather clumsy, and also doesn't work. Better to do it this way:

obj/Fireball
density = 1
proc/Walk_Loop(var/dir = NORTH, var/dist = 5, var/speed = 1)
spawn()
while(dist > 0)
step(src, dir)
dist--
sleep(speed)
Bump(atom/A)
if(ismob(A))
var/mob/M = A
world << "[M] was hit"
del(src)

mob/verb/Fire()
var/obj/fireball/F = new(loc)
F.Walk_Loop(src.dir)
In response to Garthor
I was trying to maintain the original idea...
And your code will not work either. :3
Mines been repaired now.
Meh, what's wrong with using the built in missile proc?
In response to Chowder
Oops, forgot a proc/

Silly me.
In response to Garthor
Thank you guys this really helped out. I really dont even have an idea of a game I want to make, I just knew whatever it was I would need to use projectiles.

Its interesing i didn't know that all of the Move's contents actually go into the object itself

Edit: Garthor also, yours does not work, i will try to fix if i can.

:18:error: F.Walk_Loop: undefined type: F.Walk_Loop
:17:error: F: unknown variable type

edit: nevermind it was just a spelling mistake i found it
In response to Garthor
Better still to make the fireball's New() proc handle setting it in motion. Rarely is it worthwhile to have the caller handle that stuff.

Lummox JR