The Dink Network

Reply to Re: Script interference

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:
 
 
July 22nd 2018, 09:01 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
Well, if I understand it right, you already know what your issue is. While Dink is frozen, the original script is interfering, making the bartender say a line of text, and then the rest of his script is not executing, resulting in dink remaining frozen. Is this correct?

If so, there are multiple ways you could approach the fix.
But first, I just want to mention, it is not advisable to store sprites in variables using there editor numbers with sp(#), as sprite numbers can change. I think this is also warned in the DinkC reference, in saying that, I've used them before in certain situation and it works fine. If you want to be safe, store the sprite in a global. Or don't, it's up to you.

Now, one simple way without changing everything around would be to simply disable the other script from interfering at any point that dink should be talking to the bartender. You could simply set the bartender's gold value to 1 (this is like an extra little local variable you can use, sort of).

So right before freezing dink:

sp_gold(&current_sprite, 1);

and after dink is unfreezed:

sp_gold(&current_sprite, 0);

Then in the other script you can do a check, and if the bartenders gold value is 1, do not proceed with the conversation, simply go back to the loop.
Eg:

int &check = sp_gold(&pr, -1);
if (&check != 0) goto loop;

make sure there's a wait in between the loop, and the goto command as well, to prevent extreme lag.
I'm sure others will offer other fixes, but this a simple one, that will work.