Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, degenerate_762, ozgur), 1,311 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to keep from retriggering an impact? #386681
11/08/11 10:36
11/08/11 10:36
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
Lire-C...the player is moving fine, either standing or walking. What I want advice on how can I make it do is what you see in PS3 games, the player walks up to a note on the wall and a panel pops up which says "Press return to examine". How to do this and not keep re triggering it because you're next to the object? I have an easy to understand impact action from Aum 103/code/Events. I know how to code panels. I need to trigger the action only once. When I got it to trigger a sound, the sound triggers endlessly, a horrible nose until I back away from the model with the impact code attached.
How can I get it to detect the player and do some things, say leave the panel on the screen until a button is pressed?
Ideally I'd like two choices, like press A to view panel or B to break out of the loop.


Learning to write lite-C -- A8 commercial
Re: How to keep from retriggering an impact? [Re: Delirium] #386682
11/08/11 11:16
11/08/11 11:16
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Code:
action object()
{
	set(my,INVISIBLE | PASSABLE); // optional
	while(!player) wait(1); //wait for valid pointer
	my.skill1 = 1;
	while(my.skill1)
	{
		if(vec_dist(my.x,player.x) < 64)
		{
			set(pnl_help,SHOW);
			if(key_a || key_b)
			{
				do sth
				my.skill1 = 0;
				reset(pnl_help,SHOW);
			}
		}
		else reset(pnl_help,SHOW);
		wait(1);
	}
	ptr_remove(me);
}



Last edited by Superku; 11/08/11 11:17.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: How to keep from retriggering an impact? [Re: Superku] #386683
11/08/11 11:27
11/08/11 11:27
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
That looks like exactly what I need. say, I was just making a tga panel for this function and tried to code a panel and even the syntax for that changed, testing it the level says "panel" undeclared identifier. Here is my panel code:

panel* press_pan =
{pos_x =400; pos_y=100;
layer = 11;
bmap = look.tga;
flags = overlay;
}

I put that code before the main{} and was going to call it within the action by a "reset (presspan, show);"

Last edited by Delirium; 11/08/11 11:27.

Learning to write lite-C -- A8 commercial
Re: How to keep from retriggering an impact? [Re: Delirium] #386684
11/08/11 11:42
11/08/11 11:42
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,
perhaps

Code:
PANEL* press_pan =
{
pos_x = 400; pos_y=100;
layer = 11;
bmap = "look.tga";
flags = OVERLAY;
}



Last edited by 3dgs_snake; 11/08/11 11:43.
Re: How to keep from retriggering an impact? [Re: 3dgs_snake] #386685
11/08/11 12:02
11/08/11 12:02
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
Is that any diffferent than this? I tried this panel code, which is working in a RPG inventory code, just changing the name of the panel and the tga, and it say "Undeclared Identifier"
What is this undeclared identifier I frequently get? doesn't describing it declare it? How do I "declare" it?

PANEL* p1_help = // panel to show
{
bmap = look_tga;
pos_y = -2; // feel free to play with this value
layer = 10;
flags = SHOW;
}


Learning to write lite-C -- A8 commercial
Re: How to keep from retriggering an impact? [Re: Delirium] #386686
11/08/11 12:17
11/08/11 12:17
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
As Pappenheimer told you in another thread, lite-C is case-sensitive. Therefore, panel*, text* and the like are undeclared identifiers, PANEL*, TEXT*, ... are declared identifiers.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: How to keep from retriggering an impact? [Re: Superku] #386687
11/08/11 12:59
11/08/11 12:59
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
That did seem to correct it. Thanks.


Learning to write lite-C -- A8 commercial

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