var/turf/Ice/A = new /turf/Ice/
ID:158453
Aug 21 2009, 1:50 am
|
|
I need an attack which creates a turf....but how can i define the location of the created turf? (Actually i just need something what activates when a mob enters it,and deactivates when mob exits)
|
In response to GhostAnime
|
|
runtime error: bad loc
proc name: Hail (/mob/verb/Hail) source file: verbs.dm,6524 usr: Guest-2449684958 (/mob/player) src: Guest-2449684958 (/mob/player) call stack: Guest-2449684958 (/mob/player): Hail() mob//Attacks Well...it creates one....but....it doesn't help....cause replacing a turf...is no no,i just need something that will be there for a while and activate upon Entered() and deactivate upon Exited() |
In response to Destrojer
|
|
anyone?
|
In response to Destrojer
|
|
Oh god, that is so fugly!
Lets break it apart: if(usr.firing >= 1) Do most people forget about ||? Also, you should look up boolean tricks in the DM forum: if(usr.firing || usr.rest) // if firing/rest is TRUE [any value except 0, "" or null] ... oh god, the next several hundred lines (exaggeration, I know) is horrible ... you forgot about locate()! You are sending 3 separate arguments instead of 1!! Alternatively, you could have looped through block() and had a few lines in there: for(x in block(...)) MOST IMPORTANTLY you did not heed my warning. As soon as those new turfs are deleted, there will be just black spots remaining. I recommend hail being an /obj, with you introducing the custom procedure StepOn() [See [link]] |
In response to GhostAnime
|
|
Note that, in what you linked, SteppedOn() is what you'd want to use, not StepOn().
|
In response to Garthor
|
|
Ummm....i need a little help with block.
mob//Attacks It sends me to a black screen and doesn't create the obj-s |
In response to Destrojer
|
|
You need to define something specific for the for() loop to loop through. Just telling it to loop through "x" is like telling it to loop through nothing or everything. Since you want turfs, you want to define the argument as a typepath of turf.
for(var/turf/x in block(blah,blah)) EDIT Oh wait, since "x" (in your case) has a null value, it's looping through all the null values in that block. EDIT2 Also, some advice. var/obj/objects/o = new /obj/o(loc) The only reason you should use one of the first two methods is when you want to edit the newly created atom's variables after its creation process. |
Remember, replacing turfs at runtime will result with the previous turf being deleted.
As for activation/deactivation, look up Entered() and Exited().