The Dink Network

Reply to Re: Execution of script on game load

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
August 1st 2012, 10:33 AM
wizardg.gif
Paul
Peasant He/Him United States
 
Have you checked out this thread? It starts out a little confusing, but by the end we had a pretty solid way to launch these kind of scripts worked out.

The gist of it is that main.c runs every time you load a game. It also runs on the title screen, but it should be easy enough to check which is which using if (&story > 0) or something like that. Like any other script, main.c gets killed when a screen draws (including the initial screen on loading a save), so to prevent that you have it either script_attach(1000) or just have main.c spawn() a new script, which will keep running after main.c stops.