Functions In Fenix


Racemaniac

Scorched GP programmer
Joined
Nov 3, 2003
Messages
587
Website
Visit site
I've run into a problem, in one part of the program i have to assign a value to a local variable of a process, if i just do a rand(0,maxvalue) everything works perfectly
if however i use a function to decide that value i sometimes get an error about either something about the type of process (TANK in this case) or that a process calls upon another process that doesn't exist...
if i raise the priority it seems to happpen less frequent (not sure, sometimes it happens fast, other times it can work for a long time without problems :s, so hard to be sure about such htings), but still happens...

is there something that can go wrong when i let a process call a function so it has to wait until that function returns a value...

btw, usually it's procediemento x no activo, and x being a pretty low number (0 or 3 or so), what could it mean?
 
I think it`s one of those fenix bugs, you get when referring to local variables via ID.
I got this error a lot of times when trying stuff.
Maybe try the set the ID to false if something happens to a process.

Maybe it happens when one of the tanks get killed? And something is trying to manipulate that killed process, so just try putting a IDOFTHATPROCESS=false; ´to the code that kills the process.
 
Quiest posted on Sep 26 2005 at 10:54 PM said:
I think it`s one of those fenix bugs, you get when referring to local variables via ID.
I got this error a lot of times when trying stuff.
Maybe try the set the ID to false if something happens to a process.

Maybe it happens when one of the tanks get killed? And something is trying to manipulate that killed process, so just try putting a IDOFTHATPROCESS=false; ´to the code that kills the process.
first of all for safety reasons the process of a tank never gets killed, to prevent such issues :s
secondly, it's done on a moment where the tank process is not disturbed by other processes...

so i'm kind of wondering what's happened...

although i just saw something even stranger happen: because the function malfunctioned, i put the code inside the tank function. all of a sudden the X value of the tank got changed (while nowhere in the code that value is altered). i in the function call yet another function that simply returns 0 (that's all it does, just a dummy untill i make the real process), if i took away that part of the code it appeared to work again... no more x values getting altered etc... i'm now testing the original function without calling that function, lets hope for the best...

and random values getting altered, this is a lot like a pointer overflowing somewhere, but i'm afraid it's not in my code :(

*edit* damn, still unstable :(
 
Last edited by a moderator:
i think it's just that the process becomes too long or so that causes fenix to go unstable...
i'm now trying with a process instead of a funtion, it's a local variable, so i can alter it from another process, lets hope it's stable :)
 
Since you are using functions you are using 84b right. You do know that you MUST NEVER use the first defined local in 84b. When you are declaring name the first local you define 'trash' or something. It's a Fenix bug in the internal declaration of locals, it defines one too less and the calculation where to find the variable in memory goes wrong, adapting wrong memory locations, so any variable could be accidentally changed instead of your precious first local. :)
 
Moogle posted on Sep 27 2005 at 04:20 PM said:
Since you are using functions you are using 84b right. You do know that you MUST NEVER use the first defined local in 84b. When you are declaring name the first local you define 'trash' or something. It's a Fenix bug in the internal declaration of locals, it defines one too less and the calculation where to find the variable in memory goes wrong, adapting wrong memory locations, so any variable could be accidentally changed instead of your precious first local. :)
i'm using the older version, not the version that was recently released :)
and what do you mean by locals? the privates of a function/process or the locals you define for all processes/functions?
 
Last edited by a moderator:
Back
Top