Out of date coding (FIXED)

Started by ShadeJackrabbit, Fri 23/12/2005 19:31:18

Previous topic - Next topic

ShadeJackrabbit

I didn't. I'm using a RON template that GBC gave a link to. I'm trying to make it run, yet it won't.

Elliott Hird

MakeGame();

AddPuzzle();

ShadeJackrabbit

You aren't being very helpful. How can I make a game if I can't test it or save it because of an error? Answer that before you make rude (to me at least) remarks.

Akumayo

Replace "Save" with the "SaveDialogue" function methinks.
"Power is not a means - it is an end."

ShadeJackrabbit

That doesn't work. Then it says SaveDialogue is undefined.

Akumayo

Check the manual for Save/Load functions
"Power is not a means - it is an end."

ShadeJackrabbit

#26
Now I've got a problem with SetCursorMode. Undefined Token AGAIN.
FIXED

Akumayo

SetCursorMode isn't used anymore.

Use instead:

Mouse.Mode = eModeLook;

or

Mouse.Mode = eModeUse;

etc.
"Power is not a means - it is an end."

ShadeJackrabbit

#28
Oh great, another problem:
Code: ags

Error (line 59): Parse error in expr near 'eModeUseinv'

Code: ags

  if (button==2) Mouse.Mode = eModeUseinv);

FIXED
So anybody knows, I am using a GUI which is like the lucasarts one, link to it's topic:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=18974.0

Akumayo

The last closing brace is unneccessary.
"Power is not a means - it is an end."

ShadeJackrabbit

#30
Different error: (disregard what was previously here)
Code: ags

Error (line 63): 'top_inv_item' is not a public member of 'GameState'

Code: ags

  if ((button == 7) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed))  {
      game.top_inv_item = game.top_inv_item + game.items_per_line;  }
  if ((button == 6) && (game.top_inv_item > 0))  { 
      game.top_inv_item = game.top_inv_item - game.items_per_line;  }
  }

FIXED

Akumayo

Replace:
Code: ags

  if ((button == 7) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed))  {
      game.top_inv_item = game.top_inv_item + game.items_per_line;  }
  if ((button == 6) && (game.top_inv_item > 0))  { 
      game.top_inv_item = game.top_inv_item - game.items_per_line;  }
  }


With:
Code: ags

if (button == 7) {
  ScrollUp();
}
if (button == 6) {
  ScrollDown();
}
"Power is not a means - it is an end."

ShadeJackrabbit

Only problem is that ScrollUp is an undefined token.

monkey0506

#33
Okay, you have to give a script o-name to your InventoryWindow...and then put that (and a period) in front of ScrollUp...such as if you name it MainInvWindow then it would be:

MainInvWindow.ScrollUp();

ShadeJackrabbit

But now it says that ScrollUp is not a public member of 'GUI'.

Akumayo

"Power is not a means - it is an end."

ShadeJackrabbit

Sure:
Code: ags

#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) {
if (interface == COM) {
  if (button==0) Mouse.Mode = eModeWalkto;
  if (button==1) Mouse.Mode = eModeLookat;
  if (button==2) Mouse.Mode = eModeInteract;
  if (button==3) Mouse.Mode = eModePickup;
  if (button==4) Mouse.Mode = eModeTalkto;
  if (button==5) Mouse.Mode = eModeUsermode1;
if (button == 7) {
  gInv.ScrollUp();
}
if (button == 6) {
  gInv.ScrollDown();
}

Akumayo

Ahh, found your problem!Ã,  You wrote "gInv", the 'g' indicates that Inv is indeed a GUI.Ã,  However, it's actually the Inventory Window that you need to give a script name to.Ã,  Ya' know, the box that all the inventory shows up in?Ã,  You have to click that and assign it a name... like... err... Inventory.Ã,  I think that would work.Ã,  So after re-naming the Inventory Window "Inventory", change the code to:
Code: ags

if (button == 7) {
Ã,  Inventory.ScrollUp();
}
if (button == 6) {
Ã,  Inventory.ScrollDown();
}


I'm pretty sure that'll patch it up.
"Power is not a means - it is an end."

ShadeJackrabbit

It almost does, but it says that a "[" is expected.

Akumayo

We'll need to see the scriipt again  :P
"Power is not a means - it is an end."

SMF spam blocked by CleanTalk