Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 975 guests, and 2 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
Page 1 of 2 1 2
engine_getscript + wait #307726
01/31/10 10:07
01/31/10 10:07
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Hi,

Im using engine_getscript to call a function.
But if that function hit's a wait in it, it will get terminated instead.
Why is this, and more importantly, can this be fixed (through a work-around or in the engine)?

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: engine_getscript + wait [Re: Helghast] #308007
02/01/10 09:46
02/01/10 09:46
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
also, sys_exit("whatever in here") quits the game without displaying any string whatsoever. (only when called through engine_getscript).

Hope this helps a bit more.

regards


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: engine_getscript + wait [Re: Helghast] #308009
02/01/10 10:02
02/01/10 10:02
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
What is your problem? sys_exit and wait are explained in the manual.

http://manual.3dgamestudio.net/aexit.htm


Re: engine_getscript + wait [Re: jcl] #308013
02/01/10 10:16
02/01/10 10:16
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
yes, but i am talking about a function that runs through engine_getscript.

If the function that runs through this contains a wait, it immediatly get terminated (without doing anything that's still in the function).
Same happens with sys_exit and a string parameter, no string is displayed, engine just shuts down.


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: engine_getscript + wait [Re: Helghast] #308014
02/01/10 10:30
02/01/10 10:30
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
That sounds perfectly normal to me. Have you read the manual? Can you describe your problem in detail?

Re: engine_getscript + wait [Re: jcl] #308017
02/01/10 10:36
02/01/10 10:36
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
ofcourse;
I'm running this piece of code from a model:

Code:
runStringFunction = engine_getscript(my.string1);
if(runStringFunction) { runStringFunction(); }



which is basically what the manual wrote wink (yes, i have defined "void runStringFunction();" global).

now, whatever function runs off of that works fine, untill the point it hits a wait in it. at that point, the whole function is terminated.
I wanted to know why that happens, and if there is a way around it?

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: engine_getscript + wait [Re: Helghast] #308018
02/01/10 10:38
02/01/10 10:38
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
For the third time: just read the manual. Of course it's terminated because wait always terminates a function.

"Wait temporarily terminates the function (like return), stores its local variables and the my and you pointers, stores the function state in an internal list (Scheduler List), and returns to the calling function (if any)."


A computer does not read your mind - it just does what you tell it to do.

Re: engine_getscript + wait [Re: jcl] #308068
02/01/10 13:50
02/01/10 13:50
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
yes, i got that part, it just doesnt return to the calling function after the wait, the whole function stops after it (and doesnt move on the next frame).

I just used the wrong terminology there, i'm sorry, "terminated" should've said "quit without resuming".

The manual doesnt say anything on that (not under engine_getscript or under wait).
Or i'm getting it completely wrong, and the manual should be more clear about that?


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: engine_getscript + wait [Re: Helghast] #308075
02/01/10 14:23
02/01/10 14:23
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Hmm, what do you mean with "it doesn't return to the calling function"? The calling function does not continue?

Re: engine_getscript + wait [Re: jcl] #308076
02/01/10 14:28
02/01/10 14:28
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
the function that has the wait in it, doesnt continue running after the wait, when it was called through engine_getscript.
so yes, the calling function does not continue.


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

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