Quote
An exception 0xC0000094 occured in ACWIN.EXE at EIP = 0x00444F8B ; program pointer is +1004, ACI version 2.71.894, gtags (14,22)
(...)
in Enviornmental Effects (line 155)
I managed to get around this the first time it happened, but I don't know what exactly is making it happen. I coded:
Overlay* a_envoverlay;
At the beginning of my module script, in one function I make a_envoverlay using CreateGraphical:
a_evnoverlay = Overlay.CreateGraphical(...yadda yadda...);
The error is being generated by this line, which is located in the module's repeatedly_excecute_always() function:
a_envoverlay.X += Random(speed);
What's happening?
-Regards, Glacies Akumayo
Note that if you just put that line in repeatedly_execute_always() it's supposed to be executed EVERY game loop in EVERY room.
If the overlay is not valid and you try to refer to it your game will crash.
So the question is, are you sure the overlay is valid in EVERY game loop in EVERY room?
A safeguard method to do that is to use the following more complicated code instead:
if (a_envoverlay!=null) {
if (a_envoverlay.Valid) a_envoverlay.X += Random(speed);
}
if (a_envoverlay != null) {
if (a_envoverlay.Valid) a_envoverlay.X += Random(windspeed);
}
Now the same error is being generated, but for the line saying:
if (a_envoverlay.Valid) a_envoverlay.X += Random(windspeed);
I'm very confused now....
I'm not sure if += works with properties correctly, so try
a_envoverlay.X = a_envoverlay.X + Random(speed);
What is windspeed set to? It's not something silly like -1 is it?
I worked it out after all... it seems windspeed was indeed being set to -2 through a previous randomizer.Ã, I fixed it up, positive integers only nowÃ, :)
What a silly mistake eh?
-Thank you, Glacies Akumayo
Nevertheless, AGS should handle it better, so I'll look into the erro rhandling for Random.