ID:263247
 
Code:

    wall    
verb
Tag_Sly()
set src in view(1)
new /obj/sly(O, usr.dir)
var/obj/O = new /obj/sly


Problem description:
im trying to make a graffite game but i need it to graff all i need is for it to make a new obj 1 space infront of the users direction

Evil Productions wrote:
Code:

>   wall    
> verb
> Tag_Sly()
> set src in view(1)
> new /obj/sly(O, usr.dir)
> var/obj/O = new /obj/sly
>

Problem description:
im trying to make a graffite game but i need it to graff all i need is for it to make a new obj 1 space infront of the users direction


/*
var/obj/sly/O only if you are going to use it as a reference, if you don't byond's compiler will actually warn you that you are declaring a variable that is not being used.

as for your new /obj/sly(O, usr.dir) CRYS...

to get the next location infront of the users location,
get_step(Ref,Dir)

*/

var/obj/sly/O = new(get_step(usr,usr.dir))

Also, if I may I think your design is flawed. Your using a verb for your wall. In this verb you do a set src in view(1). What does this statement do?

What I am getting at is this. If I was facing up and to the left of me was a wall with this verb. I could use this verb and create that object where there is no wall.
In response to Green Lime
rite set src view(1) mean when someones with in one step the verb will show
In response to Evil Productions
set src *in* view(1)
Here use this instead it's cleaner and it works I tested it:
turf
wall
icon='Test.dmi'
icon_state="wall"
density=1
opacity=1
DblClick()
if(src in oview(1))
switch(input("Which One?","TAG")in list("sly","sly2"))//asks the usr which one and shows the a list
if("sly")//if they pick this one
overlays += /obj/sly//puts graffiti on top of wall
if("sly2")//if they pick ths one
overlays += /obj/sly2//puts graffiti on top of wall


obj
sly//#1
icon='Test.dmi'
icon_state="sly"
layer = MOB_LAYER+99
sly2//#2
icon='Test.dmi'
icon_state="sly2"
layer = MOB_LAYER+99

also if you want I can help you make it so they can use there own icon's as graffiti too.
In response to Hellsing4
Hellsing4 wrote:
Here use this instead it's cleaner and it works I tested it:

(code)

also if you want I can help you make it so they can use there own icon's as graffiti too.



lolol i ween!1!!
     
turf
wall
icon = 'Test.dmi'
icon_state = "wall"
density = 1
opacity = 1
DblClick()
set src in oview(1)
var/sly_choice = input("sly or sly2") in list("sly","sly2")
usr.overlays += icon('Test.dmi',sly_choice)
// just so you know, you could also squeeze the input() in the icon proc.


In response to Hellsing4
Thank you hell this has helped a great deal if you want would you like to help make this game with me add my msn [email protected]
In response to DivineO'peanut
yeah that would work too but when I said its cleaner I meant that it was cleaner than his code
In response to DivineO'peanut
  
turf
wall
icon = 'Test.dmi'
icon_state = "wall"
density = 1
opacity = 1
DblClick()
set src in oview(1)
var/sly_choice = input("Which Graffitti?","Tag It!!") in list("sly","sly2")
/*get rid of the usr.for this to work*/usr.overlays += icon('Test.dmi',sly_choice)

And you WEEN! you didn't even test this did you.
(also note:)That if you use this than the icon_state for your graffitti must be put in the list.
In response to Hellsing4
its allready done dude
In response to Pyro_dragons
you could have it so that its a player verb and not attached to the walls themselfs.
mob
verb
Tag_Sly()
var/turf/wall/T = locate(/turf/wall) in get_step(src,src.dir)
if(T)
if(istype(T,/turf/wall))
// T = the wall infront
// src = the player
// the rest of your code below

have fun
In response to Zmadpeter
Zmadpeter wrote:
> mob
> verb
> Tag_Sly()
> var/turf/wall/T = locate(/turf/wall) in get_step(src,src.dir)
> if(T)
> if(istype(T,/turf/wall))
> // T = the wall infront
> // src = the player
> // the rest of your code below
>


No, that will not work. using <code>locate() in area</code> will try and find movable objects. Since what you want to find is a turf, you can just simply set T to get_step(src, src.dir), then do the various checks.

var/turf/wall/T = get_step(src, src.dir)
if(T && istype(T, /turf/wall))
...


~~> Unknown Person
In response to Unknown Person
Unknown Person is correct V_V (dam it) using locate() will not pickup the turf.

mob
verb
Tag_Sly()
var/turf/wall/T = get_step(src,src.dir)
if(T)
if(istype(T,/turf/wall))
// T = the wall infront
// src = the player
// the rest of your code below