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 - Ashen

#2961
OK, I see the problem. You need to take everything afterÃ,  function interface_click(int interface, int button) { out ofÃ,  function on_key_press(int keycode) { and put it in toÃ,  function interface_click(int interface, int button) { (which you can see at the bottom of the second picture you posted.)

So, you should have:
function on_key_press(int keycode) {
Ã,  // called when a key is pressed. keycode holds the key's ASCII code
Ã,  if (IsGamePaused() == 1) keycode=0;Ã,  // game paused, so don't react to keypresses
Ã,  if (keycode==17)Ã,  InterfaceOn(3);Ã,  Ã,  // Ctrl-Q
Ã,  if (keycode==363) GUIOn(5);Ã,  Ã, // F5 Save GUI
Ã,  if (keycode==365) GUIOn(4);Ã,  // F7 Load GUI
Ã,  if (keycode==367) RestartGame();Ã,  // F9
Ã,  if (keycode==434) SaveScreenShot("scrnshot.bmp");Ã,  // F12
Ã,  if (keycode==9)Ã,  Ã, show_inventory_window();Ã,  // Tab, show inventory
Ã,  if (keycode==19)Ã,  Debug(0,0);Ã,  // Ctrl-S, give all inventory
Ã,  if (keycode==22)Ã,  Debug(1,0);Ã,  // Ctrl-V, version
Ã,  if (keycode==1)Ã,  Ã, Debug(2,0);Ã,  // Ctrl-A, show walkable areas
Ã,  if (keycode==24)Ã,  Debug(3,0);Ã,  // Ctrl-X, teleport to room
}

Then, further down the script (line 105 in the second screenshot):
function interface_click(int interface, int button) {

Ã,  if (interface == ICONBAR) {
Ã,  // whatever is already here
Ã,  }Ã,  // end ICONBAR

Ã,  if (interface == INVENTORY) {
Ã,  Ã,  // whateverÃ,  is already here
Ã,  } // end INVENTORY

Ã,  if (interface == 3) {
Ã,  // Quit Gui interactions
Ã,  } // end Quit GUI

if (interface==4) { // if Restore interface
Ã,  string text;
Ã,  int index;
Ã,  if (button==1) {// if cancel is pressed
Ã,  Ã,  InterfaceOff(4); // Close interface
Ã,  }

Ã,  else {
Ã,  Ã,  Ã, index=ListBoxGetSelected(4,0); // else get the selected game
Ã,  Ã,  Ã, RestoreGameSlot(savegameindex[index]);
Ã,  } // restore the game
} // end Load GUI

if (interface==5) { // if save interface
Ã,  string text;
Ã,  int index;
Ã,  if (button==0) { // if enter is pressed
Ã,  Ã,  index=ListBoxGetNumItems(5,3);Ã,  // Count saved games
Ã,  Ã,  if (index<20) { // if less than 20
Ã,  Ã,  Ã,  GetTextBoxText(5,0,text); // Get the typed text
Ã,  Ã,  Ã,  InterfaceOff(5); // Close interface
Ã,  Ã,  Ã,  SaveGameSlot(index+1,text);
Ã,  Ã,  } // Save game (text as description)

Ã,  Ã,  else { // if saved games are 20
Ã,  Ã,  Ã,  index=ListBoxGetSelected(5,3); // Get the selected save game
Ã,  Ã,  Ã,  GetTextBoxText(5,0,text); // Get the typed text
Ã,  Ã,  Ã,  InterfaceOff(5); // Close the interface
Ã,  Ã,  Ã,  SaveGameSlot(savegameindex[index],text);
Ã,  Ã,  } // Overwrite the selected game
Ã,  }

Ã,  if (button==2) InterfaceOff(5); // if cancel is pressed close interface
} // end Save GUI
} // end function interface_click.

Edited, as I realised I hadn't changed the InterfaceOff()'s and GetTextBoxText()'s and that.
#2962
Can you post the lines around line 89? It looks like you've missed a } somewhere.
#2963
Like SilverWizard said, you don't actully need to be able to script to use AGS. That said, if you do learn it, there's even more flexibility in what you can do.

Try playing around with the script language to get to know it before you actually try to make anything with it, that's how I learnt. That, and reading old posts in the forums.

As to learning another language first, unless you're likely to use it once you know it, I don't see that it'd have any advantage over just keeping at AGS. However, if you think it'd be easier (maybe because other languages have more support available), the AGS scripting is based on C++, so that might be a good place to start.
#2964
Looks fine, except you'll want to change:

  if (keycode==363) SaveGameDialog();   // F5
  if (keycode==365) RestoreGameDialog();  // F7

to

  if (keycode==363) GUIOn(1);   // F5 Save GUI
  if (keycode==365) GUIOn(0);  // F7 Load GUI

Or what ever numbers the save and load GUIs are. The rest of it goes under:

function interface_click(int interface, int button) {
#2965
A while ago, Scorpiorus posted a template for highlighting inventory items on a custom GUI.

http://www.agsforums.com/yabb/index.php?topic=14752.msg180225#msg180225

Maybe this could be adapted to only work over the rubbishbag, and show a GUI with an animatable button on, istead of the empty box. Take a look at the template for a better idea of what I mean. There'd still be a bit of scripting to do, but the bulk would be taken care of.

Just a suggestion for when you get back to this.
#2966
Yes, replacing any

if (interface == 0) {
  //whatever
}

if (interface == 1) {
  //whatever
}

that might already be there. Another point: make sure they refer to the right GUIs, by default 0 and 1 are the STATUSLINE and ICONBAR GUIs.
#2967
Keyboard control Tutorial:
http://www.sylpher.com/TutScriptsWalk.html

Platformerius: The Ninja Incident (AGS-based Platform demo)
http://www.agsforums.com/games.php?action=detail&id=220

Another AGS-based platform demo
http://www.agsforums.com/yabb/index.php?topic=13052.0

Are these any use? I used the first to make a Pacman-style mini-game for something I was working on, before I realised I'd put more effort into it than the full game. Neither of them got finished.

The other 2 show what's possiblewith AGS for arcade/platform style games.

EDIT: Damn, Barbarian beat me to it while I was looking up the links. Oh, well...
#2968
Sorry, Viktor, should've been clearer. The 'string text;' and 'int index;' line go at the beginning of the script you've alread got. In full (but cleaned up a little):

function interface_click(int interface, int button) {

if (interface==0) { // if Restore interface
Ã,  string text;
Ã,  int index;
Ã,  if (button==1) {// if cancel is pressed
Ã,  Ã,  InterfaceOff(0); // Close interface
Ã,  }

Ã,  else {
Ã,  Ã,  Ã, index=ListBoxGetSelected(0,0); // else get the selected game
Ã,  Ã,  Ã, RestoreGameSlot(savegameindex[index]);
Ã,  } // restore the game
}

if (interface==1) { // if save interface
Ã,  string text;
Ã,  int index;
Ã,  if (button==0) { // if enter is pressed
Ã,  Ã,  index=ListBoxGetNumItems(1,3);Ã,  // Count saved games
Ã,  Ã,  if (index<20) { // if less than 20
Ã,  Ã,  Ã,  GetTextBoxText(1,0,text); // Get the typed text
Ã,  Ã,  Ã,  InterfaceOff(1); // Close interface
Ã,  Ã,  Ã,  SaveGameSlot(index+1,text);
Ã,  Ã,  } // Save game (text as description)

Ã,  Ã,  else { // if saved games are 20
Ã,  Ã,  Ã,  index=ListBoxGetSelected(1,3); // Get the selected save game
Ã,  Ã,  Ã,  GetTextBoxText(1,0,text); // Get the typed text
Ã,  Ã,  Ã,  InterfaceOff(1); // Close the interface
Ã,  Ã,  Ã,  SaveGameSlot(savegameindex[index],text);
Ã,  Ã,  } // Overwrite the selected game
Ã,  }

  if (button==2) InterfaceOff(1); // if cancel is pressed close interface
}

#2969
Only found 3 Oddities so far, but I'm working on it....
The cheer when I found the first one scared the bejeesus outta me, I thought it was a cat screaming.

Is anyone else having difficulty using the items in the inventory? I mean, getting them to be 'active'.

Other than that, looking good, nice use of a Ghostbusters character, eagerly awaiting the full version.
#2970
if (interface==0) {// if Restore interface
  string text;
  int index;
  if (button==1)

and:

if (interface==1) { // if save interface
  string text;
  int index;
  if (button==0)

Also, you might want to call the GUIs by name instead of number, e.g. LOADGUI and SAVEGUI, as it's easier to tell which bit of the script refers to which GUI then.
#2971
Nostradamus:
Spoiler
Get the knife from the knife thrower in the bar. Use it on the cactus, then use the cactus chunk on the morter & pestle.
[close]
#2972
Critics' Lounge / Re: C&C on new Darksiders BG
Sun 04/07/2004 20:18:27
Quote from: Mr_Frisby on Sun 04/07/2004 03:04:32
The light from the door is a bit much though. It looks like god's behind there.

Well, the game is set in the afterlife, so you never know.....
Glad to see this is back in production, especially looking so good, but I agree that the light sources are a bit extreme. Nice and atmospheric in small doses, but could get annoying if the whole game is like that.

And, Scousers are not fat bastards. We're just bloated through lager retention.
#2973
Also, looking at it again, I think it should be:

Conditional - If variable is set to a certain value (dialog3, 1)
    Conditional - If variable is set to a certain value (dialog 1, 1)
        Run script (both in van)
        Stop running more commands
    Run script (one is missing)

Conditional - If variable is set to a certain value (dialog 1, 1)
    Run script (one is missing)

I don't know if that's what stopped it working, but the second 'Conditional - If variable is set to a certain value (dialog3, 1)' isn't really needed.
#2974
Ok, misunderstood the question a little. Try this way:

Conditional - If variable is set to a certain value (dialog3, 1)
    Conditional - If variable is set to a certain value (dialog 1, 1)
        Run script (both in van)
        Stop running more commands
    Run script (one is missing)

Conditional - If variable is set to a certain value (dialog 1, 1)
    Conditional - If variable is set to a certain value (dialog3, 1)
        Run script (both in van)
        Stop running more commands
    Run script (one is missing)
#2975
It's probably be easiest to create another variable to track whether they're both in the car.

Create a new variable called GotBoth

Conditional - If variable is set to a certain value (dialog3, 1)
   Run script (whatever you've already got)
   Conditional - If variable is set to a certain value (dialog 1, 1)
      Game - Set variable value (GotBoth, 1)

Conditional - If variable is set to a certain value (dialog 1, 1)
   Run script (whatever you've already got)
   Conditional - If variable is set to a certain value (dialog3, 1)
      Game - Set variable value (GotBoth, 1)

Conditional - If variable is set to a certain value (GotBoth, 1)
   Run script (Or whatever you want to happen next)

And delete this bit:
Conditional - If variable is set to a certain value (dialog3, 1)
   Conditional - If variable is set to a certain value (dialog 1, 1)
      Run script

Hope this helps.
#2976
So, what's so complicated? Just use more 'Conditional - If variable is set to' commands.

Make a global variable called phone

Phone interaction:
Conditional - If variable is set to a certain value (phone, 0)
  Game - Display message (Make a message that says something like "I wouldn't know who to call")
Conditional - If variable is set to a certain value (phone, 1)
     Game - Run dialog (2)
     Game - Set variable value (phone, 2)
Conditional - If variable is set to a certain value (phone, 3)
     Game - Run dialog (4)
     Game - Set variable value (phone, 4)

Talk to character:
Conditional - If variable is set to a certain value (phone, 0)
     Game - Run dialog (1)
     Game - Set variable value (phone, 1
Conditional - If variable is set to a certain value (phone, 2)
     Game - Run dialog (3)
     Game - Set variable value (phone, 3)
Conditional - If variable is set to a certain value (phone, 4)
     Game - Run dialog (5)
     Player - Go to another room


Dialog 1 = First time talk to character
Dialog 2 = First phone call
Dialog 3 = Second time talk to character
Dialog 4 = Second phone call
Dialog 3 = Third time talk to character
#2977
You could use the Interaction editors variables, instead of GlobalInts
So:

Make a Global variable called dialog

Talk to Character:
Conditional - If variable is set to a certain value (dialog, 0)
      Game - Run dialog (1)
      Stop running more commands
Game - Run dialog (2)


Computer Interaction:
Game - Set variable value (dialog, 1)
// And Game - Display message if you want it to say 'Message sent'
#2978
If you just want to change a few lines, use SetDialog option, in the computer's interaction, e.g.

  SetDialogOption (1, 2, 0); // Turns off 'OK, Ill e-mail it' response in dialog 1
  SetDialogOption (1, 3, 1); //Turns on 'I sent you an e-mail' response in dialog 1
  DisplaySpeech (EGO, "OK, I sent the E-Mail);

If you want to change a lot of the dialog, it'd probably be easier to use a different dialog, e.g.:

Talk To Character:
Run Script:
  if (GetGlobalInt (2) != 1) {
  RunDialog (1);
  }
  if (GetGlobalInt (2) == 1) {
    RunDialog (2);
  }


Computer Interaction:
Run Script
  if (GetGlobalInt (2) != 1) {
    DisplaySpeech (EGO, "OK, I sent the E-Mail);
    SetGlobalInt (2, 1);
  }
  if (GetGlobalInt (2) == 1) {
    DisplaySpeech (EGO, "Nah, I already sent it.");
  }
#2979
I think the problem is that AnimateCharacter () is blocking, which means ReleaseCharacterView() is called before the animation happens. My bad.
Try:

AnimateCharacterEx (FISH, 0, 5, 0, 0, 1);

And yes, you can use multiple commands, provided you remember the braces  - { and }. For a single command, you'd only need:

if (character[GetPlayerCharacter()].inv[1] > 0) DisplaySpeech(JER, "GIVE ITEM MESSAGE");
#2980
I think the problem is that the variables used in the interaction editor (Conditional - If variable is set to a certain value, Game - Set variable value) aren't the same as the GlobalInts. It looks like you're trying to use a combination of scripting and the interaction editor, and have gotten the two 'types' of variable confused. Use one or the other, e.g.:


Scripting Method:

Character A interaction:
Run Script:
Ã,  if (GetGlobalInt (10) == 0) {
Ã,  Ã,  RunDialog (1);
Ã,  }
Ã,  if (GetGlobalInt (10) > 0) {
Ã,  Ã,  RunDialog (2);
Ã,  Ã,  SetGlobalInt (10, 2);
Ã,  }

Character B interaction:
Run Script:
Ã,  if (GetGlobalInt (10) < 2) {
Ã,  Ã,  RunDialog (5);
    SetGlobalInt (10, 1);
Ã,  }
Ã,  if (GetGlobalInt (10) == 2) {
Ã,  Ã,  // whatever you want to happen
Ã,  }


Interaction Editor Method:

First, create a Global Variable called dialog.

Character A interaction:
Conditional - If variable is set to a certain value (dialog, 0)
Ã,  Game - Run dialog (1)
Ã,  Stop running more commands

Game - Run dialog (1)
Game - Set variable value (dialog, 2)

Character B interaction:
Conditional - If variable is set to a certain value (dialog, 2)
Ã,  (whatever you want to happen)
Ã,  Stop running more commands

Game - Run dialog (5)
Game - Set variable value (dialog, 2)


Hope this helps.
SMF spam blocked by CleanTalk