The Dink Network

Reply to Re: is there a make_global_int max? (simulating extra globals)

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:
 
 
April 4th 2018, 10:02 AM
spike.gif
SlipDink
Peasant He/Him United States bloop rumble
2nd generation. No easy way to be free. 
There are several ways to make more global variables available (or at least to sort of fake that). I'm pretty certain that these approaches work in all 1.08 or later versions of Dink.

My favorite technique is to use editor_seq() and/or editor_frame() which let you save values associated with a particular editor placed sprite (on any specific screen) in save files. The v3.1 version of the DINKC Reference has this section explaining it:


#editor_seq()
#editor_frame()
# Category: Editor Data
# Prototype:
# int editor_seq( int DinkEdit#, int value <-1 to not change> );
# int editor_frame( int DinkEdit#, int value <-1 to not change> );

[The <DinkEdit#> argument is the sprite's number as assigned by DinkEdit:
use sp_editor_num() to retrieve it. The <value> argument is included in
save files. When editor_type() (below) is 0, the <value> stored by
editor_seq()/editor_frame() has no particular meaning to the dink engine
and, within limits, may be used to store values unrelated to the commands'
intended purpose. The value is 0 by default and may be retrieved by
passing -1 as the <value> argument.]

See editor_type() (below) and "Part 3: A Changing World" for a complete
description of this facility; see also sp_editor_num().

Another technique is to use sp_custom() to attach some new value to any active sprite on any screen. The good news about this one is that "Each sprite can store unlimited keys." as the documentation spells out in "The DinkC Reference v4.0" windows help file (which I believe is bundled with the dink windows download found here). This windows help file describes the use of the sp_custom() function. As it is the 4.0 version of the earlier text based DinkC reference, it also mentions the editor_seq() and/or editor_frame() methods.

Good Luck!