Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/21/26 19:15
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 6,962 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Serious User
DLively  Offline 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.


Code:
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 laugh

Last edited by DevoN; 06/11/10 00:13.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: event_type = event_impact - not working for me [Re: DLively] #328236
06/11/10 08:15
06/11/10 08:15
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
who is "you" in this context?

since the you pointer will be set to the colliding model once the event is triggered.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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 Offline
Expert
EvilSOB  Offline
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
Code:
...		
		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 Offline OP
Serious User
DLively  Offline OP
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Guess I should have explained what is going on here, a bit better tongue

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'


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: event_type = event_impact - not working for me [Re: DLively] #328276
06/11/10 13:16
06/11/10 13:16
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Funny... looks like it should work, does it beep?


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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 Offline
Expert
Uhrwerk  Offline
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] #328281
06/11/10 14:14
06/11/10 14:14
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
if the teleporter doesen't move it should be

EVENT_ENTITY

?

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
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Quote:
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 Offline OP
Serious User
DLively  Offline 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 grin


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
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 Offline
Expert
Uhrwerk  Offline
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...
Page 1 of 2 1 2

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

Gamestudio download | 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