The Dink Network

Reply to Re: What are all the keys that can be used in scripts?

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:
 
 
June 14th 2024, 08:41 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
FIX dupe keycall bug on phone below, will work now and forever, even if Seth fixes the engine bug and/or breaks it again in any future release!

This fix uses no new global variables, and no editor_seq or editor_frame fake variables, it won't interfere with your dmod. It only stores things in unique sp_custom key values on sprite 1 (Dink).

Good thing is, this fix does not check for if the player is playing on the phone specifically, it only checks if any time at all has passed between the previous key### script and the new one. I did some testing, and the duplicate script on phone is called at exactly the same time as the first one without even 1 millisecond delay. So I wrote a procedure you can call from external that will return the time between the previous key### script call and the current one, then you just check the return value and if it equals 0, do a kill_this_task(). All this will do is make sure there has to be at least 1 millisecond between script calls for whichever key### scripts that have this applied.

It can be applied to key scripts and I tested it on PC DinkHD which doesn't have the dupe bug, and it doesn't interfere, so even if Seth fixes the bug, you don't have to remove it!

All you have to do is put the following script in your story folder: dupekill.c

And then put this at the very top of the main procedure of your key-### so it runs before anything else:
 external("dupekill", "dupekill");
 int &dupekill = &return;
 if (&dupekill == 0)
 {
  //There was no delay since the last key-### call and this one!
  //dupe key-### call detected without even a millisecond between calls - kill this off now!
  kill_this_task();
 }