PDA

View Full Version : Global Integers



Joe123
12-10-2007, 07:05 PM
The system does save global integers when you save and quit the game, right?

I think I'm actaully going to cry if it doesn't...

I'm locked out of initial data, and Link starts with all of the items at the moment, so I put this clause into my global script:

if(init == 0){
Link->Item[13] = false;
Link->Item[125] = false;
Link->Item[23] = false;
Link->Item[10] = false;
Link->Item[127] = false;
Link->Item[54] = false;
Link->Item[52] = false;
Link->Item[31] = false;
Link->Item[29] = false;
Link->Item[126] = false;
Link->Item[91] = false;
Link->MaxHP = 16*8;
Link->HP = 16*8;
Game->Counter[2] = 4;
init = 1;
}

And I have a global integer called init. But when I save and restart the game after getting an item, it still removes that item from Link :(

pkmnfrk
12-10-2007, 07:08 PM
Globals should save, yes. Where, exactly, is init declared?

Joe123
12-10-2007, 07:16 PM
import "std.zh"

bool bluetunic = false;
int bsw1 = 0; int bsw2 = 0;
bool redtunic = false;
int rsw1 = 0; int rsw2 = 0;
bool goldtunic = false;
int gsw1 = 0; int gsw2 = 0;
int usewhistle; int usecape;
int noroll = 0;
const int nerm = 26;
const int invis = 128;
int yrupee = 0; int bombs = 0;
int init; int medallion1 = 0;

Here, right at the beggining.

Gleeok
12-10-2007, 07:18 PM
Uuh...wtf, it should store 1 to init.

Perhaps try:

int init = 0;

...?

Unless the game already uses an global int called init.

Maybe try initialafantastico = 0; ..or something. lol

Joe123
12-10-2007, 07:22 PM
OK, I'll try that. I'm really at my wits end here, I've put so much work into this and if this doesn't work the whole thing is useless pretty much.
I need a new build so much :(
Why can't we have a new build? :(

It's not working...
What can I do...

Eh, wait. It's not that thats causing the problem.
Now that's strange.
Because the script also set's Links bombs to 4, but they didn't get reset.

Would someone mind taking a look at my quest to see if they can work out why it's happening?

Gleeok
12-10-2007, 07:27 PM
Well heck, i'm using 675 still. there hasn't been that many changes.

Are you by anychance using 2 global scripts, or is init part of an ffc script?

Joe123
12-10-2007, 07:30 PM
Yes but the changes that there have been apply to me quite significantly :(

* Damage combos now no longer do 1/16 of a heart of damage sometimes when "Full Priority Damage Combos" is enabled.
* Opening cheats or init data will no longer crash some quests where the bomb ratio is 0
* Fixed the bug that allowed 'land-swimming' with walkable water
* Fixed the bug that was preventing Dive Warps, Swim Warps and Dive for Item flags from working with walkable water - not to mention preventing Link from holding up items.
* Giving Link a Ring with scripts will now change his colours appropriately

The one about opening cheats or init data is the problem.

And no, I'm not using two seperate global scripts, and I've tried putting it on an ffc script on the first screen instead, but that's just got the same problem.

But...
I'm starting to think it's something different, because my bombs didn't get set back to 4, it was just my candle being taken away this time...

Gleeok
12-10-2007, 07:35 PM
??? did you try setting it to 0? maybe post the script. :shrug:

pkmnfrk
12-10-2007, 11:43 PM
Well, I would try removing the whole init block anyway, to make sure that things are as they appear...

Joe123
12-11-2007, 03:54 AM
Well, it's not to do with the script for sure.

The script removes Link's items, and set bombs to 4.
Items are being removed; bombs are not being set to 4.

I sent it to Shoelace, and he said he hasn't had this saving issue, so I'm assuming it's ZC bug, maybe to do with my save file or something, I don't know.