Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by AndrewAMD. 12/06/23 17:16
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (AndrewAMD, miwok, TipmyPip, 3run, 1 invisible), 631 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Need little help with TEXT and freeze mode... #263686
05/01/09 12:48
05/01/09 12:48

C
chris_oat
Unregistered
chris_oat
Unregistered
C



Hi again,

i use this code below, and i modify it a little bit. First, i tried to use the freeze_mode while the message is shown, but the game keeps freezing, wats wrong in my code?
and Second: How can i do it, so the message disappier again and the game stop freezing again only wen i hit the space key again.

CODE:---------

TEXT mymessage_txt
{
pos_x = 300;
pos_y = 100;
string("Damn! The way is blocked by a big hole in the floor!");
}

action my_blkdway
{
while (!player) {wait (1);}
while (1)
{
// if the player comes close to the object
if (vec_dist(player.x, my.x) < 100) // play with 100
{
if (key_space)
{
while (key_space)
{
wait (1);
} // wait until the space key is released
mymessage_txt.visible = on;
freeze_mode = 1;
wait (3);
freeze_mode = 0;
// for 3 seconds
mymessage_txt.visible = off;
}
}
wait (1);
}
}

Last edited by chris_oat; 05/01/09 19:50.
Re: Need little help with TEXT and freeze mode... [Re: ] #263727
05/01/09 19:49
05/01/09 19:49

C
chris_oat
Unregistered
chris_oat
Unregistered
C



nobody can help me here? crazy

Re: Need little help with TEXT and freeze mode... [Re: ] #263728
05/01/09 19:58
05/01/09 19:58
Joined: Apr 2009
Posts: 298
Southern Oceans
KiwiBoy Offline
Member
KiwiBoy  Offline
Member

Joined: Apr 2009
Posts: 298
Southern Oceans
Looks like you got syntax mixed up.
Havnt tested this but it should look something like this...compare with yours and the source and you will see defferrence I think.
Code:
action my_blkdway
{
while (!player) {wait (1);}
while (1)
	{
// if the player comes close to the object
		if (vec_dist(player.x, my.x) < 100) // play with 100
		{
		if (key_space)
		{
		while (key_space){wait (1);}		 // wait until the space key is released
		mymessage_txt.visible = on;
		freeze_mode = 1;
		wait (3);
		freeze_mode = 0;
// for 3 seconds
		mymessage_txt.visible = off;
	}
	}
wait (1);
}
}



Use the 'manual' Luke, the manual is your friend. 'Self reminder' smile

My WebPage
Re: Need little help with TEXT and freeze mode... [Re: KiwiBoy] #263736
05/01/09 20:43
05/01/09 20:43

C
chris_oat
Unregistered
chris_oat
Unregistered
C



hope sorry, but stil not working, if i press space the message appears and the game freezes, but it keeps freeze and i can not do anything...

Re: Need little help with TEXT and freeze mode... [Re: ] #263741
05/01/09 23:31
05/01/09 23:31
Joined: Apr 2009
Posts: 298
Southern Oceans
KiwiBoy Offline
Member
KiwiBoy  Offline
Member

Joined: Apr 2009
Posts: 298
Southern Oceans
Sorry, just gave as example for comparison, not a tested script.
I think the while loop is out of place, should be above if(key_space) I think.
Something more like this
Code:
action my_blkdway
{
while (!player) {wait (1);}
	while (1)
	{	
		while (key_space){wait (1);}		 
	// wait until the space key is released
		// if the player comes close to the object
		if (vec_dist(player.x, my.x) < 100) // play with 100
		{
		
		mymessage_txt.visible = on;
		freeze_mode = 1;
		wait (3);
		freeze_mode = 0;
		// for 3 seconds
		mymessage_txt.visible = off;
		wait (1);
	}
	

}



Use the 'manual' Luke, the manual is your friend. 'Self reminder' smile

My WebPage
Re: Need little help with TEXT and freeze mode... [Re: KiwiBoy] #263767
05/02/09 08:04
05/02/09 08:04
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i gues your function get freezed to

not tested
Code:
function pauze()
{
my = NULL;
freeze_mode = 1;
wait(-3);
freeze_mode = 0;
}

...
		mymessage_txt.visible = on;
		pauze();
		mymessage_txt.visible = off;
		wait (1);

..



"empty"

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