ID:175986
 
heres my building system
mob
var
buildtype
building = 0
buildmethod

mob
verb
make_obj()
var/newtype = input("What type?")in typesof(/obj)+"Cancel"
if(newtype == "Cancel")
return
usr.buildtype = newtype
selectbuildtype()
var/newtype = input("What type?")in typesof(/atom)+"Cancel"
if(newtype == "Cancel")
return
usr.buildtype = newtype

startbuild()
usr.building = 1
usr.buildmethod = input("Select your method to build")in list("Click","Drag")
usr.MouseEntered(/obj/box,/atom)
stopbuild()
usr.building = 0
usr.MouseEntered(null,null)

turf
Click()
if(usr.building && usr.buildmethod == "Click")
new usr.buildtype(src)
return
usr << "You're not building! Or your method isn't on Click!"
return

MouseDrag(typeb,unused,location)
if(usr.building && usr.buildmethod == "Drag")
typeb = usr.buildtype
new typeb(location)
else
return


My question is, i wanna drop that the choose click drag etc and i just want the build system to always use a "block" style of building, similar to "fill" when building maps in DM. Can anyone help me on adding that within this code? And also, similar to DM, when building i want a "box" type icon to appear in whatever tile the mouse pointer is but i only want the "box"(box.dmi) to be visable to the builder, If anyone can help me on that, I would be very apprecaitive


ETG
that build system looks familiar.....=P and look up mousedrop()=P
In response to Magnus VI
Magnus, that build system was given to me by nadrew, which was also given to you, and mouse drop..... Il look at that thanx. but anyone else help is accepted
In response to Erdrickthegreat2
mob
var
buildtype
building = 0
buildmethod

mob
verb
make_obj()
var/newtype = input("What type?")in typesof(/obj)+"Cancel"
if(newtype == "Cancel")
return
usr.buildtype = newtype
selectbuildtype()
var/newtype = input("What type?")in typesof(/atom)+"Cancel"
if(newtype == "Cancel")
return
usr.buildtype = newtype

startbuild()
usr.building = 1
usr.buildmethod = input("Select your method to build")in list("Click","Drag","Block")
usr.MouseEntered(/obj/box,/atom)
stopbuild()
usr.building = 0
usr.MouseEntered(null,null)

turf
Click()
if(usr.building && usr.buildmethod == "Click")
new usr.buildtype(src)
return
usr << "You're not building! Or your method isn't on Click!"
return

MouseDrag(typeb,unused,location)
if(usr.building && usr.buildmethod == "Drag")
typeb = usr.buildtype
new typeb(location)
else
return
MouseDrop(typeb,typeb,location)
if(usr.building && usr.buildmethod == "Block")
typeb = usr.buildtype
new typeb(location)
else
return


Ok this is my Build system now, but the MouseDrop() doesnt work the way i wanted it, I wanted it to make the buildtype i selected as a box withing everywhere i drag. similar to the "fill" used in maps in DM. If anyone can help, I think its an mistake withing the arguments but im not sure, I'd greatly appreciate your help. Curently i click and drag the mouse and wherever i release it makes one of the object.

ETG
In response to Erdrickthegreat2
well of course it wont work, its not mousedrag!
here
look at it like this
mousedrop(turf/a,turf/b)
then use block(a,b)
you figure out the rest =P
In response to Magnus VI
Um, ok that doesn't make sense, but um even though i have helped you in the past....*cough*roof*cough*be that way....*cough*
In response to Erdrickthegreat2
fine</DM>
turf/MouseDrop(turf/a,turf/b)
//ifs in here
for(var/turf/T in block(a,b))
new usr.buildtype(T)</DM>
try that
*COUGH*you owe me *COUGH**COUGH* my seeareas works*COUGH**COUGH=P*COUGH*
In response to Magnus VI
heh, thanx magnus =)
In response to Erdrickthegreat2
startbuild()
usr.building = 1
usr.buildmethod = input("Select your method to build")in list("Click","Drag","Block")
usr.MouseEntered(/obj/box,/atom)
why doesnt this do what i think it should do

usr.MouseEntered(/obj/box,/atom)

It seems it should make obj/box where my mouse pointer is when build is on and i have defined build and the icon but is doesnt work, any idea why?
In response to Erdrickthegreat2
i forget the args for mouseentered, but its a proc called when your mouse enters something, you cant call a proc like that like that
In response to Magnus VI
well, MouseEntered(location) so location is the argument But what could i do to fix this or in exchange of it?
In response to Erdrickthegreat2
figure out to use images yourself
turf/MouseEntered()
overlays+=/obj/box
turf/MouseExited()
overlays-=/obj/box

you maybe want to use iamges