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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, TipmyPip, AndrewAMD), 1,209 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Little problem with wait #412152
11/23/12 13:26
11/23/12 13:26
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Hey guys laugh
Ive got a problem and stuck now over 2 days. I have a simple function in my game, and I call it to respawn people. When I call the wait(-10) or any other wait, the function is terminating itself o_0
So before wait is an error box, after it nothing happens. Yes, Im using proc_kill in my game, but just with function pointers and not in my netcode at all. Please help me frown

Code:
function net_respawnPlayer(var time, var id)
{
	createWeapon(id);
	
	wait(-time);
	
	pHealth[id] = 100;
	pPlayer[id].health = pHealth[id];
	enet_sendto(&(pPlayer[id].health), sizeof(int), BROADCAST);
.......


Re: Little problem with wait [Re: Ch40zzC0d3r] #412160
11/23/12 14:10
11/23/12 14:10
Joined: Nov 2011
Posts: 139
India
Yashas Offline
Member
Yashas  Offline
Member

Joined: Nov 2011
Posts: 139
India
A negative number in wait indicates seconds.
Are you sure you have waited that many time seconds before taking the desicion that the functions never continues??
Are you sure that the value you to time is not something 100 or 1000 or so??
Did you try wait(-10); once??
Can you please give the arguments that you give to the function
An Example Working Code(Extract from my app):
Code:
PANEL * Splashscreen =
{
	bmap = SplashscreenImage;	
	alpha = 100;
	flags = TRANSLUCENT;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void VideoStartup ()
{
	video_mode = 10;
	video_screen = 1;
	mouse_mode = 4;
	master_vol = 100;	
}
////////////////////////////////////////////////////////////////////////////////////////////////////
int main ()
{
	VideoStartup ();
	wait_for(VideoStartup);
	var time = 5;

	wait(-t1ime);
	Splashscreen.scale_x = screen_size.x / bmap_width(SplashscreenImage) - 0.04;
	Splashscreen.scale_y = screen_size.y / bmap_height(SplashscreenImage);
	wait(-time);
	while(Splashscreen.alpha > 0)
	{
		Splashscreen.alpha -= 5;
		wait(0.01);	
	}
	reset(Splashscreen,SHOW);
	bmap_purge(SplashscreenImage);
	return 0;	
}



Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Little problem with wait [Re: Yashas] #412171
11/23/12 15:34
11/23/12 15:34
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
I just fixed this :|
It was a wrong set my-pointer, IDK why it paused my wait instruction.
And yeah, I was sure about the wait. I even tried wait(1) and it didnt work.
However now its working, thanks for your help laugh

BTW: Someone has got a nice zombie model?

Re: Little problem with wait [Re: Ch40zzC0d3r] #412228
11/24/12 11:11
11/24/12 11:11
Joined: Nov 2011
Posts: 139
India
Yashas Offline
Member
Yashas  Offline
Member

Joined: Nov 2011
Posts: 139
India
I don't understand what caused your function freeze in the middle of execution smirk


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Little problem with wait [Re: Yashas] #412232
11/24/12 13:00
11/24/12 13:00
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
The scheduler will automatically unschedule all functions which my pointer becomes NULL. That's why the wait never "returned".


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Little problem with wait [Re: WretchedSid] #412243
11/24/12 15:39
11/24/12 15:39
Joined: Nov 2011
Posts: 139
India
Yashas Offline
Member
Yashas  Offline
Member

Joined: Nov 2011
Posts: 139
India
humm... Thanks laugh


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages

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