lasting messeges?

I once again im stuck here so here is what my problem is

example

you have a cube that when mouse over and left click it sets a its property to 1
and then there is another cube that when you click it it sends a message to the first cube saying to spin k but the first cube has to have the property set to one and the message inorder to spin but what i want is that say you have to click on the the second cube to say you want a object to spin then you click on the first cube saying this is the object that you want to spin so is there any way of somehow when a object gets a message for it to hold it untill its ready to use it. i could do this using propertys but for what im doing it would be 80 or so propertys and it would make to much logic to deal with. so does anybody know of a way of doing this plz? thanks in advance.

This is hard to read …

Could you explain this is some shorter sentences?

If I read it correctly you want to:

A) select an object of a certain type via LMK
B) when clicking an “button” to enable an animation at the currently selected object.

Is that correct?

I suggest to separate the logic into:

Selection
Communication
Action performing

Selection
Quite simple you already did that:

  • Mouse over + LMK -> AND -> set property

alternative:

  • Mouse over + LMK -> AND -> set state “Selected”

Remarks:

  • I prefer the state change method. It provides much better overview and is much more efficient.
  • How do you want to clear the selection?

Communication
You had the right idea too. But you need a small change. Do not send a message to a specific object. This creates an unwanted dependency. Just send the message to all. Each object that should deal with this kind of message simply gets an message sensor.

Sender (button):
mouse over + LMK -> message subject “spin”

All receivers:
message sensor subject “spin” -> whatever

Remarks:

  • You can have as many communication channels as you want. Each one should have a separate message subject.

Action performing
Here you define the "whatever from the communication.
In your case
message sensor subject “spin” -> motion Rot [0,0,1] or ActionActuator or whatever you like

You want selected objects to perform the “action” only. This is quite simple:
if using states:

  • The message sensor is only evaluated in the right state (selected).

if using a property:

  • message sensor + property sensor -> AND -> “action”

Remarks:

  • Each receiver can have a different “action”

Simple Selection Demo

Attachments

simpleSelect.blend (43.9 KB)

ok so the demo is exactly what i want except reverse instead you click spin then you click on the object that you want to spin.

bare in mind this spinning object thing has nothing to do with my game its just an example

in my game i have a store type thing and an inventory so when i click on the item then click on the slot in the inventory it the slot adds the item and it works it just i have to do it reverse because i have the inventory slot when clicked set a selected property to 1 and if it res-eaves a message from the store button and its property is set to 1 it adds the object but the problem is you can select the store object first because when it sends a message it only lasts for a second.

No problem. Simply setup two independent selections. You can do that by using separate unselect messages:
“unselect item”
“unselect slot”

Slot:
when in selected state:
On entering selected state -> send “selected slot”
On receipt of “selected item” -> Add 1 + send “unselect item” + send “unselect slot”

Item:
when in selected state:
On entering selected state -> send “selected item”
On receipt of “selected slot” -> send “selected item”

Check this demo:
It rotates the “slot” a bit each time an item and a slot is selected. You could easily replace it with a property.

But from here I suggest to introduce Python as this gets to complicated with Logic bricks alone.

Attachments

simpleSelect_v.2.blend (44.5 KB)

ok thanks! this looks good

Problem solved? If so, it would be best to change the topic’s prefix to “SOLVED” so it won’t cause any confusion. :wink:

oh sry i will

thanks again monster :slight_smile: