O Ilusionista
Captain 100K
I am making a function where I will change my colourmap to a specific one then revert to the previous colourmap if I use the right value. The goal here is since I will be using the same burn and shock sprites for almost every char on the mod, I don't want to add those colors on each characters palette.
So:
-I get my current map and store it as a variable, if the variable is NULL
-if the value is that I want is greater than 4 (the chars have 4 palettes. palette 5 is for burn and 6 for shock), change to the desired value
- if not, change to the original palette (I will me using the function two times).
On the frame 1, I will use "@cmd paleta 5" and on the last one "@cmd paleta 0"
The code
But it return the following error:
What is wrong? And where I can see more about this and that OpCode, since it isn't in any manual?
So:
-I get my current map and store it as a variable, if the variable is NULL
-if the value is that I want is greater than 4 (the chars have 4 palettes. palette 5 is for burn and 6 for shock), change to the desired value
- if not, change to the original palette (I will me using the function two times).
On the frame 1, I will use "@cmd paleta 5" and on the last one "@cmd paleta 0"
The code
void paleta(int Pal)
{//
void self = getlocalvar("self"); //Get calling entity.
int oPal = getentityproperty(self, "colourmap"); // get actual colourmap
int cor = getindexedvar(0); //store it on a var
if (cor==NULL()){ //if the var is NULL
setindexedvar(0, oPal);
}
if (Pal > 4){
changeentityproperty(self, "colourmap", Pal);
}
else{
changeentityproperty(self, "colourmap", getindexedvar(0));
setindexedvar(0, NULL());
}
}
But it return the following error:
Script function 'getindexedvar' returned an exception, check the manual for details.
OpCode: 8
OpCode: 8
What is wrong? And where I can see more about this and that OpCode, since it isn't in any manual?