I have three functions currently, they are enemy_attack(); enemy_bite(); and enemy_constrict();
In my global scipt I have the following:
function enemy_attack() {
if (GetGlobalInt(106)==1) {
//You are fighting a sneak
SetObjectGraphic(1, 0);
if (GetGlobalInt(108)==1) {
SetGlobalInt(70, 5);
SetGlobalInt(71, 0);
SetGlobalInt(72, 0);
SetGlobalInt(73, 0);
SetGlobalInt(74, 1);
SetGlobalInt(75, 1);
SetGlobalInt(76, 1);
SetGlobalInt(108, 0);
}
SetGlobalInt(107, Random(1));
if (GetGlobalInt(107)==0) {
//Sneak will use bite
enemy_bite();
GUIOn(BATTLE);
}
if (GetGlobalInt(107)==1) {
//Sneak will use constrict
enemy_constrict();
GUIOn(BATTLE);
}
}
function enemy_bite() {
SetObjectGraphic(2, 0);
SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
DisplayMessage(546);
SetObjectGraphic(2, 0);
}
function enemy_constrict() {
SetObjectGraphic(2, 0);
SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+2));
SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+2));
DisplayMessage(546);
SetObjectGraphic(2, 0);
}
And in my GUI script I call the enemy attack(); like so
enemy_attack();
I have already imported all the functions in the script header, but I get this message when trying to save the game:
function enemy_bite() {
SetObjectGraphic(2, 0);
SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
DisplayMessage(546);
SetObjectGraphic(2, 0);
}
Error (line 30): already referenced name as import; you must define it before using it
How do I fix this?
In my global scipt I have the following:
function enemy_attack() {
if (GetGlobalInt(106)==1) {
//You are fighting a sneak
SetObjectGraphic(1, 0);
if (GetGlobalInt(108)==1) {
SetGlobalInt(70, 5);
SetGlobalInt(71, 0);
SetGlobalInt(72, 0);
SetGlobalInt(73, 0);
SetGlobalInt(74, 1);
SetGlobalInt(75, 1);
SetGlobalInt(76, 1);
SetGlobalInt(108, 0);
}
SetGlobalInt(107, Random(1));
if (GetGlobalInt(107)==0) {
//Sneak will use bite
enemy_bite();
GUIOn(BATTLE);
}
if (GetGlobalInt(107)==1) {
//Sneak will use constrict
enemy_constrict();
GUIOn(BATTLE);
}
}
function enemy_bite() {
SetObjectGraphic(2, 0);
SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
DisplayMessage(546);
SetObjectGraphic(2, 0);
}
function enemy_constrict() {
SetObjectGraphic(2, 0);
SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+2));
SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+2));
DisplayMessage(546);
SetObjectGraphic(2, 0);
}
And in my GUI script I call the enemy attack(); like so
enemy_attack();
I have already imported all the functions in the script header, but I get this message when trying to save the game:
function enemy_bite() {
SetObjectGraphic(2, 0);
SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
DisplayMessage(546);
SetObjectGraphic(2, 0);
}
Error (line 30): already referenced name as import; you must define it before using it
How do I fix this?