Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 938 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
un-assinig an entity SOLVED* #143599
07/26/07 16:27
07/26/07 16:27
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
entity* selected;

in my game you point and click on objects then click where you want them to move
for example say i clicked on the chair

selected = me; // the chair = selected

and then i change my mind ang click on the table

selected = me; // the table = selected, but the chair is still selected too, how do i un-sellect something? or rather "selected != chair" or somthing like that?

Last edited by RyuShinji; 07/26/07 17:54.
Re: un-assinig an entity [Re: RyuShinji] #143600
07/26/07 16:52
07/26/07 16:52
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
If all furnitures are assigned to the same action
it should work probably.

Code:

entity* selected;

function selectMe()
{
if (event_type == event_click)
{
selected = my;
//.... other codes

}
}

action furniture
{
my.enable_click = on;
my.event = selectMe;
//....
}



Re: un-assinig an entity [Re: vlau] #143601
07/26/07 17:00
07/26/07 17:00
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
It didnt work, for some reason it keeps the old object as selected too and still moves it with it..?

also the chai and the table were just an example im acualy using 2 of the same objects would this matter?

Last edited by RyuShinji; 07/26/07 17:12.
Re: un-assinig an entity [Re: RyuShinji] #143602
07/26/07 18:55
07/26/07 18:55
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
It doesn't matter even they are the same model. Here is an example
to prove it.

Add 2 entities (same model) in your level, edit skill1 = 1 for the first one
and skill1 = 2 for the second one, then add the following script :

Code:

var test1;
entity* selected;

panel printValue
{
pos_x = 0;
pos_y = 0;
digits (10,10,3,_a4font,1,test1);
flags = visible;
}

function selectMe()
{
if (event_type == event_click)
{
selected = my;
test1 = selected.skill1;
}
}

action furniture
{
my.enable_click = on;
my.event = selectMe;
}

function main()
{
level_load(...);
wait(2);
}



If succeed, it should show 1 or 2 while clicking on the model, or else,
post your code here.

Good luck!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1