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.
ID:157818
Dec 27 2009, 10:21 pm
|
|
This might help you get started. You can see an example of it in Tower Defense: Clone Wars.
mob 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. |
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