ID:157818
 
How can i make a Click-to-Build system? I've made it so that there is a hub with a bunch of floors and walls, and when you click on them, your mouse pointer turns into that icon. I'm having trouble with the click-to-build part.

Help please.
i dont understand what you want the code to do "click-to-build" ?

you can use the mouse pointers code (use help on in dream maker for more info)

and Click() DblClick()

after Click()
a normal code comes you just need to remember the src is what you click usr is who is clicking

to create new object just use new object(location)

if you need more info ask more specfic questions i will be glad to help you
This might help you get started. You can see an example of it in Tower Defense: Clone Wars.

mob
var
m_SelectedStamp; // Store the icon state
proc
//
// Pass in the turf you want to turn into a stamp
//
Mob_SetMousePointer(var/turf/stamp/s)
m_SelectedStamp = s.icon_state;
var/icon/I = new("Icons/Icon.dmi", m_SelectedStamp);
I.Scale(20, 20);
client.mouse_pointer_icon = I;
Mob_RestoreMousePointer()
client.mouse_pointer_icon = initial(client.mouse_pointer_icon);


Then you need to figure out what to do when the mob clicks on something. Check the mobs m_SelectedStamp to create a new turf where the old one was.

ts
In response to Tsfreaks
I actually had that part down. I need help with the actual building part. Sorry, i'm kind of a beginner coder. =/
In response to Arcticblast
Arcticblast wrote:
I actually had that part down. I need help with the actual building part. Sorry, i'm kind of a beginner coder. =/

According to the reference entry for client/Click():
Format:
Click(object,location,control,params)

Args:
object: the object clicked
location: the client stat panel, location (turf) of object on map, grid cell, or other control-specific info
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

It seems to me that, as long as you check that the control argument is a known map control, the location argument could make client/Click() quite useful for this purpose.