ID:273002
 
dont know how to do that demo and or explanation please?

im trying to make an attack system where you train by clickng a certain part of an icon when told to do so.
There's a gun demo or something somewhere, and when you click, a red dot appears in the exact same spot that you clicked. Look into it?
In response to Demon_F0rce
gun? ill look it up now thank you
In response to Demon_F0rce
cant seem to find it any idea where it could be?
Well, the applicable mouse proc(s) have a params argument, which includes in it (in params-style) the info on exactly which pixel of the icon was clicked, as offsets.
It would be easier and more convenient to just use a separate obj for the recognizable part, so when that part is clicked it goes to that obj's Click() proc.
In response to Kaioken
thanks that makes sense i think ill try that. however i might have to use params since i cant make a player a bunch of different objects
In response to B-mut
It doesn't have to be actually a part of the player. The other obj(s) just need to be at the same place as the player (say, turf) and appear on top of him, so they appear to be a part of him. Anyway, you can use either method, I guarantee you that the 2nd one would be doable for whatever you're planning. If this is only for temporary training minigame which is initiated in separate segments (or 'sessions') from the actual game, it should be easy to get right.
In response to Kaioken
well ill mess around with it but since you say obj are easier ill probably try those first.
In response to B-mut
Well then, here's an example. If you want the head of the mob to react differently when it's clicked, make an obj which's icon is just the head (in the same position as the mob). Then give it a higher layer than the mob (simply MOB_LAYER+1 will usually work), and put it in the same location. You could give it the same name as the mob if you want the player not to be able to tell the difference yb mouseover. Then when the head is clicked, it's really the obj, so it goes to its Click() proc.
In response to Kaioken
ok that makes sense quick question, whats the difference between the mob layers? i know they are higher than the mob but does it matter which one i use?
In response to B-mut
Writing MOB_LAYER is just another way of writing 4. It's a #define macro, or a constant var, whatever - or in short a constant for the value of 4. There are other constants as well - MALE translates to the text string of "male".
Since 4 is the default mob layer, and objs have a lower layer than that by default, they display under mobs. But you want your specific obj here to appear over the mob, so you just need to give it a layer bigger than that of the mob (which is again, by default, 4). Any bigger number will work, but you shouldn't use huge numbers since then it would appear over too much stuff, for example maybe over screen objects in the HUD, if any.
<small>edit: snip, wrong text string</small>
In response to Kaioken
that makes sense thanks for the clarity on that