Periodic and Event Based Script Execution

Need More API Functions? Request Language Additions Here

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Periodic and Event Based Script Execution

Postby daenerys » Mon Oct 09, 2006 3:45 pm

Hello,

is it possible to implement some kind of interrupt handle for the scripts? E.g. it would be nice if there would be a possibility for executing a script for e.g. every x miliseconds.

Another even finer thing would be the script execution based on changes in memory, similar to the debugger interrupts.

Is this possible? If yes, this would be awsome :shock: :) :D 8)
daenerys
Hackleberry Fin
 
Posts: 25
Joined: Wed Jul 26, 2006 6:21 pm

Postby L. Spiro » Mon Oct 09, 2006 5:42 pm

Both are possible and planned.

But neither can be added yet as both rely on other parts being completed.



When ready, I will add a SetTimer() to allow you to call functions periodically as you desire.
However, to ensure that people can use this safely I have to add the “synchronized” keyword to the scripts.

This word is borrowed from Java and Java pros will know already what it does.
It allows you to define sections of code that can only be executed on one thread at a time, which is required for safe threading if you spawn function calls with SetTimer().

At the same time as I add SetTimer() I will also add a function that allows you to simple spawn a new script thread to execute simultaneously with your current thread.
This of course requires synchronized.




As for responding to changes in the target memory, this requires the debugger be finished as it will use breakpoints to call the events.
It will use the same method as exists now, where you can assign functions to breakpoints, but in this case you will assign a script function to the breakpoints.
So to call a script function when something changes, you would simply set a write breakpoint and assigne your script function to it.

Then of course you can do anything you desire in the script before allowing the game to continue.


But because of the current state of the project, these things will be a ways off for now.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby daenerys » Tue Oct 10, 2006 2:45 am

Thanks man.

Err, what is the state of the project? Did I miss something?
daenerys
Hackleberry Fin
 
Posts: 25
Joined: Wed Jul 26, 2006 6:21 pm

Postby L. Spiro » Tue Oct 10, 2006 10:32 am

The state of the project is “started over”.

You can get the demo in the General section.


No hotkeys, no hex editor, no debugger, no disassembler, etc.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby daenerys » Wed Oct 11, 2006 5:58 pm

Oh :o ,
I think I will stick with the old versions then...
daenerys
Hackleberry Fin
 
Posts: 25
Joined: Wed Jul 26, 2006 6:21 pm


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 1 guest

cron