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, 7th_zorro, dr_panther), 1,297 guests, and 6 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
Page 1 of 5 1 2 3 4 5
Manipulating the function scheduler? #385382
10/17/11 19:46
10/17/11 19:46
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Hello,

During debugging, I noticed it would be very, very useful if I could call a function between every 2 functions that the Scheduler calls. (That is, between all functions which are in a "wait"-state). Then, I also want this function to be called with the name of the next function in the scheduler as an argument.
More precisely, if this is the list of functions in the scheduler:
main
bot_move
ship_move
explosionLarge
asteroid

Then I want the functions to be called in this order:
main
debugFct("bot_move");
bot_move
debugFct("ship_move");
ship_move
debugFct("explosionLarge");
explosionLarge
debugFct("asteroid");
asteroid

Then the debugFct would always log the value of a certain pointer so I could see which function changed the pointer (or at least I'd know which function called a function which changed the value - a great step ahead from where I'm at now.)

CSiS is hundreds and hundreds of functions large, and some function randomly changes one of my Text objects. I know what Object it changes, but I can't find which function changes it. The above was my idea of how to do it, if there's a better way to do it, I'm glad to hear about it.
So is there any way to manipulate the scheduler?

Thanks, and I hope I was clear...
Micha

Edit: I'm using 7.86.6

Last edited by Germanunkol; 10/17/11 19:47.

~"I never let school interfere with my education"~
-Mark Twain
Re: Manipulating the function scheduler? [Re: Germanunkol] #385468
10/18/11 19:02
10/18/11 19:02
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Wouldn't it be possible to put the debugFct call before each wait(1);? That would basically do what you need.

Re: Manipulating the function scheduler? [Re: Lukas] #385474
10/18/11 19:27
10/18/11 19:27
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Thats why i used the C# wrapper without scheduler. Allowed me to setup everything they way i need(and allows much better logging, if this is what you aim for)


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Manipulating the function scheduler? [Re: Rackscha] #385513
10/19/11 12:38
10/19/11 12:38
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Originally Posted By: Lukas
Wouldn't it be possible to put the debugFct call before each wait(1);? That would basically do what you need.

Hm, yeah... it's just that I have about a thousand wait calls. But I guess it'll be the way I have to go, maybe there's some files I can rule out beforehand...

Rackscha, I guess that's too late for me. I'm not gonna rewrite CSiS a fourth time... But for any future projects I'll definitely think about the structure beforehand.


~"I never let school interfere with my education"~
-Mark Twain
Re: Manipulating the function scheduler? [Re: Germanunkol] #385515
10/19/11 12:49
10/19/11 12:49
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
it's just that I have about a thousand wait calls.


You could write a function, f.i. wait_log(var frames), that uses engine_gettaskinfo, some diag functions and wait(frames). Now press [Ctrl]+[H] in SED and let wait(1) automatically be replaced with wait_log(1). Continue with your other script files.


"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: Manipulating the function scheduler? [Re: Superku] #385518
10/19/11 13:45
10/19/11 13:45
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
For a coder, it shouldn't be very hard to have another debug function put in front of every wait command... automatically.


Teleschrott-Fan.
Re: Manipulating the function scheduler? [Re: Sajeth] #385519
10/19/11 13:57
10/19/11 13:57
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
What do you mean?


"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: Manipulating the function scheduler? [Re: Superku] #385523
10/19/11 16:27
10/19/11 16:27
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I think Sajeth means to code a function which will replace all my wait(1) calls.

But that's essentially what you, Superku, have also suggested, except I don't need to code it myself.

Thank you both, it is pretty embarrassing that I didn't think of the automatic replacing. I guess I hadn't gotten use to the idea of editing _every_ wait call yet...

Will try it.


~"I never let school interfere with my education"~
-Mark Twain
Re: Manipulating the function scheduler? [Re: Germanunkol] #385524
10/19/11 16:45
10/19/11 16:45
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Uhm... just write this macro:
Code:
#ifdef NDEBUG
#define wait(i) wait(i)
#else
#define wait(i) do{char *funct; engine_gettaskinfo(0, &funct, NULL); debugFct(funct); wait(i);} while(0)
#endif



A function wouldn't work for obvious reasons...


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Manipulating the function scheduler? [Re: WretchedSid] #385529
10/19/11 17:17
10/19/11 17: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)
Right, to place wait inside another function was a pretty stupid idea...


"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
Page 1 of 5 1 2 3 4 5

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