Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo
L. Spiro wrote:I have never had crashes when double-clicking items to be edited. Also the latest demo is #19.
And no it is not easily possibly to route the text to be used in the game.
You can manage it manually by getting the HDC of the process’s main window and drawing the text manually to it.
But you have to do it repeatedly and it will flicker.
And you will have to manage your own buffer, but that is not hard.
L. Spiro
Ex. let's say I want to declare 5 variables with these addresses:
5b6e40
5b6e42
5b6e44
5b6e46
5b6e48
There is an OBVIOUS pattern here... now I could sit there and declare them each manually the way you showed me. Which is:
extern WORD rooms = { "", 0x005b6e40 };
extern DWORD dwThis = { "", 0x005b6e40 };
extern DWORD dwThat = { "", 0x005b6e50 };
extern DWORD dwThose = { "", 0x005b6e64 };
dwThis = dwThat = dwThose;
enum {
E_THIS,
E_BLANK1, E_BLANK2, E_BLANK3,
E_THAT,
E_BLANK4, E_BLANK5, E_BLANK6, E_BLANK7,
E_THOSE,
};
extern DWORD dwArray[1] = { "", 0x005b6e40 };
dwArray[E_THIS] = dwArray[E_THAT] = dwArray[E_THOSE];
P.S. I'm assuming that this technique of using ARRAYS would use a LOT less memory than just declaring a ton of variables, right?
you say the addresses are 2 apart.... is there any way to make them 1 memory address apart?
Ex. array[1] =5b6e40 for even values, and then array2[1] for 5b6e41 for odd values
Since any sprite based item has 188 entries, I can just declare an array of size 1, then just point to the corresponding memory address using that var, rather than declaring 20 or so variables to do what I need.
L. Spiro wrote:Each external variable consumes (9 + module-name length) bytes of local RAM.
Use a BYTE array instead of a WORD array. You know this already.
If you are working with organized data structures in the game it is better to create a structure in your script that matches theirs and use that.
struct SPRITE {
WORD wX;
WORD wY;
BYTE bBuffer1[32];
WORD wRot;
// Etc.
};
extern SPRITE e_sEntity1 = { "", 0x5B6E40 };
e_sEntity1.wRot = 90;
L. Spiro wrote:You do too know what it means.
- Code: Select all
struct SPRITE {
WORD wX;
WORD wY;
BYTE bBuffer1[32];
WORD wRot;
// Etc.
};
extern SPRITE e_sEntity1 = { "", 0x5B6E40 };
e_sEntity1.wRot = 90;
L. Spiro
struct ENEMIES {
SHORT hspeed;
SHORT vspeed;
SHORT action1;
BYTE actiondata;
SHORT frametimer;
};
extern ENEMIES axearmor1 = { "", 0x62cdc0 };
extern ENEMIES axearmor2 = { "", 0x62eed0 };
//so Hspeed will equal 62cdc0, vspeed = 62cdc2, action1 = 62cdc4, actiondata= 62cdc5, frametimer = 62cdc6, for axearmor1 ....is that right?
//and for axearmor2 instead the memory addresses will be: Hspeed will equal 62eed0, vspeed = 62eed2, action1 = 62eed4, actiondata= 62eed5, frametimer = 62eed6. Am I on the right track here?
if (axearmor1.action1 == 4) axearmor1.hspeed = 512;
struct ENEMIES { = 0x62cdc0
SHORT hspeed; = 0x62cdc0 + 0 = 0x62cdc0
SHORT vspeed; = 0x62cdc0 + 2 = 0x62cdc2
SHORT action1; = 0x62cdc0 + 4 = 0x62cdc4
BYTE actiondata; = 0x62cdc0 + 6 = 0x62cdc6
SHORT frametimer; = 0x62cdc0 + 7 = 0x62cdc7
};
Return to General Related Discussions
Users browsing this forum: No registered users and 0 guests