Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 11,038 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
making a loading wait #331013
07/01/10 15:33
07/01/10 15:33
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
hello
i tried ti make a function that waits for something and then return, and keep the function going.

function load_wait(int* a){
wait(-2);
*a=2;
}


function main(){
int evl;
load_wait(&evl);
while(evl!=2){wait(1);}
error("ok");
}

the problem is you never see the ok message.

Re: making a loading wait [Re: MMike] #331015
07/01/10 15:41
07/01/10 15:41
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Why not using wait_for()?

wait_for(load_wait);

Re: making a loading wait [Re: Widi] #331016
07/01/10 15:43
07/01/10 15:43
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
where is that? on the manual?

Re: making a loading wait [Re: MMike] #331017
07/01/10 15:47
07/01/10 15:47
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Yeah, search for it, you will get 2 results. wait_for() is a macro and waiting till all instances of this function are finished.

Re: making a loading wait [Re: MMike] #331019
07/01/10 15:49
07/01/10 15:49
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
tryed

wait_for(load_wait(300,300,200));
error("ok");

but the ok appear immediatly which is not true because my real load_wait function is this:

Code:
function load_wait(short a, short b, var time){
PANEL* ar=pan_create("bmap=loading_map;",5);
var timex=0;
fade_pan_in(ar);
pan_set(ar,a,b);
pan_setcenter(ar); //middle rotation point default


while(timex<time){
ar.angle-=2.3;
timex++;
wait(1);}
fade_pan_out(ar); 
ptr_remove(ar);
}



PS: Some commands make part of my own Function library, so it wont work on your side.

Last edited by MMike; 07/01/10 15:52.
Re: making a loading wait [Re: MMike] #331020
07/01/10 15:51
07/01/10 15:51
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
wrong:
wait_for(load_wait(300,300,200));

use:
load_wait(300,300,200);
wait_for(load_wait);


Last edited by Widi; 07/01/10 15:53.
Re: making a loading wait [Re: Widi] #331021
07/01/10 15:53
07/01/10 15:53
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
like this? :
load_wait(300,300,200);
wait_for(load_wait);

next to each right? (since i have to call the load_wait with the right parameters.

Last edited by MMike; 07/01/10 15:53.
Re: making a loading wait [Re: MMike] #331023
07/01/10 15:54
07/01/10 15:54
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Thanks it worked.

Off-topic, your speak pT?

Last edited by MMike; 07/01/10 15:54.
Re: making a loading wait [Re: MMike] #331024
07/01/10 15:54
07/01/10 15:54
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You was faster then my edit wink


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