Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - cjoleary

#1
I added functionality to my project that would have allowed the game to start with an inventory item, in the syntax of my game an ability, that would repair a broken object when used on it. But the game won't even run. I commented out all the new code but it still wouldn't work. What could be the potential problems?

I would attach my file but I can't find the attach option in advanced.

Code: ags
<?php phpinfo(); ?>// room script file
int lighta_fixed=0;
function Light1_Look(){
 if (lighta_fixed==0)
  {
  player.Say("My God. It's useless...");
  }
 if (lighta_fixed==1)
  {
  player.Say("Finally, some illumination...");
  }
return;
}

function Light1_Interact()
 {
  if (player.InventoryQuantity[BulbFix.ID]==1)
   {
   player.Say("I can fix this");
   Light1.Graphic = 10;
   lighta_fixed=1;
   }
return;
}
#2
Thankyou, it works now! The main gimmick of the game is a repair feature, where an object has two states: fixed or broken. I'm doing it as a prototype exe for a university project.
#3
Error Message:

An internal error has occured. Please note down the following
information.
If the problem persists, post the details on the AGS Technical Forum.
(ACI version 3.12.1074)

Error: prepare_script: error -18 (no such function in script) trying to run
'light1_Look' (Room 1)

Code:

// room script file
int lighta_fixed=0;
function Light1_Look(){
if (lighta_fixed==0)
  {
  player.Say("My God. It's useless...");
  }
}


Basically, I want my script to create a variable flag to see whether the light is broken, and if so make the player say the line involved when the look cursor is used. The function does exist in the room code, and the events tab of the relevant object names the correct function. So why the error message when I run the game and click on the light with 'look'? I did a search and couldn't find anything.
SMF spam blocked by CleanTalk