ID:176919
 
can someone give me an example on how to code a "select and command" system and make it so that when you select something it shows a certain icon? On the statpanel if possible. Because i have a bunch of different emotion icons and i want the statpanel to show the target's current emotion when you select him. if it makes any difference, all the emotions icons are states under the character icon. And could you show me a short way to disable all keyboard movement?
Delita12345 wrote:
"can someone give me an example on how to code a "select and command" system and make it so that when you select something it shows a certain icon? On the statpanel if possible. Because i have a bunch of different emotion icons and i want the statpanel to show the target's current emotion when you select him. if it makes any difference, all the emotions icons are states under the character icon. And could you show me a short way to disable all keyboard movement? show me a short way to >disable all keyboard movement?"


Ok here i try:

1)"Select And Command" If you mean where you click a mob and it goes to the turf you click in view:
mob/var/iscommanded=0
mob
Blah
Click()
iscommanded=1
turf
Blah
Click(mob/M)
for(M in world)
if(M.iscommanded==1)
M.loc=locate(/turf/Blah)
else
return 0

2) Please put in more detail




3)"And could you show me a short way to disable all keyboard movement?"

mob
Move()
return 0


That seem to be what you want?
In response to Air _King
Well i have some icons to represent emotions for my mobs, and when they are selected, by the way your code works fine ;), their stats are put up on the stat panel; their emotions being a stat. Thanks for the preceding message, it really helped.
In response to Delita12345
Delita12345 wrote:
Well i have some icons to represent emotions for my mobs, and when they are selected, by the way your code works fine ;), their stats are put up on the stat panel; their emotions being a stat. Thanks for the preceding message, it really helped.



hmmmmm....
If your only doing one mob at a time you could try setting the user's vars the same as the mobs will be except null then when a mob is clicked you could assign the usr to be that mob's type.

Hope that doesnt sound confusing if it does please post again. Glad the first one helped =)
In response to Air _King
Yeah, i'm not really following on that. i have four icon states, all relativley the same, that are my emotions. i'm thinking that i have to make them objects and then move them straight to the user's inventory? and i also found out that your Move() 'return 0' proc doesn't work. it totally disables the map when you login.
In response to Delita12345
That's because you're Move()ing the player to the map, and not setting the loc directly (which is BAD).
In response to Garthor
ok, but then i can't move my mob using my command system.
It's my guess i just have to disable the directional procs one by one.
In response to Delita12345
try using usr.loc or M.loc=locate(1,1,1)//whatever for the x,y,z (or whatever applies)

OR

usr.loc or M.loc=locate(/turf/blah)



and yes make an object and transfer it, playing a game of tanks right now will post code if you cant get it in a bit.