|
0 registered members (),
6,962
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
event_type = event_impact - not working for me
#328210
06/11/10 00:13
06/11/10 00:13
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Hi Everyone! I am trying to set up a teleporter; But its not working properly. It does recognize that something is hitting it, cause it does beep; However, it doesnt send the 'you' pointer to the location its told to go to.
function tele(){
if(event_type == event_impact){
you.x = my.skill1;you.y = my.skill2;you.pan = my.skill3;
beep();
}
}
action teleporter{
my.invisible = on;
my.enable_impact = on;
my.event = tele;
}
what is missing? Thank you for your valuable time 
Last edited by DevoN; 06/11/10 00:13.
|
|
|
Re: event_type = event_impact - not working for me
[Re: Helghast]
#328240
06/11/10 08:44
06/11/10 08:44
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
If you are using physics, I dont know if a simple change of x,y,z co-ords will work. You may need to make it
...
phent_enable(you, 0);
you.x = my.skill1;you.y = my.skill2;you.pan = my.skill3;
phent_enable(you, 1);
beep();
...
I think it goes like that, Im not big on physics...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: event_type = event_impact - not working for me
[Re: EvilSOB]
#328271
06/11/10 12:43
06/11/10 12:43
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Guess I should have explained what is going on here, a bit better  the 'you' pointer is anything that impacts the teleporter; Bringing the 'you'(the entity, that bumped into it) to the chosen map position (skill1[x pos], skill2[y pos], and skill3[pan direction]) The z value is not inportant, as the game is a flat, top-view mini-game. There are no physics. I only use C_move, and skill1/2/3 for the 'reldist'
|
|
|
Re: event_type = event_impact - not working for me
[Re: Helghast]
#328278
06/11/10 13:36
06/11/10 13:36
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Place a "wait(1);" before "you.x = my.skill..." in tele().
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: event_type = event_impact - not working for me
[Re: Uhrwerk]
#328285
06/11/10 14:37
06/11/10 14:37
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
Place a "wait(1);" before "you.x = my.skill..." in tele(). But then you should save the handle, because it could be that the you pointer is invalid or points to something else after a wait.
no science involved
|
|
|
Re: event_type = event_impact - not working for me
[Re: fogman]
#328538
06/13/10 19:26
06/13/10 19:26
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
It was because I was missing a wait(1); THANK YOU Uhrwerk!! Thank you everyone else too 
|
|
|
Re: event_type = event_impact - not working for me
[Re: DLively]
#328569
06/13/10 23:49
06/13/10 23:49
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
You're welcome. :-)
Just for explanation: This event is triggered while the c_move instruction still takes place. Omitting the wait results in temporarily reseting the coordinates and having them then reverted by the c_move instruction to the old values.
Keep fogmans suggestion in mind. This is not in all cases necessary, but in at least the most cases. Alternatively set the me pointer to you.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|