Help with "Use...with", "Give...to" etc. (SOLVED)

Started by Joe, Sun 02/07/2006 17:21:12

Previous topic - Next topic

Joe

Hello, I want to add to my game an interface GUI which displays this code:

Use (inventory item selected) with (anytihng)
Give (inventory item selected) to (anyone)...

I've even made two games (really good :P) which has the interface(@overhotspot@); but I don't like it :(, please, if anyone knows which code do i have to use, let me know :).

PD: I'd also like to know how can I modify the SAVE/RESTORE game dialgog.

Thanks :).
Copinstar © Oficial Site

Ashen

I'm fairly certain these have been dealt with before. (I'm positive the Save/Restore thing has, and recently, at that.) Have you tried a forum search?

In both cases, if the forum search is no use you'll need to give more details, e.g.:
Are 'Use' and 'Give' two different modes, or should it be 'Use' over things and 'Give over Characters? Have you tried the code in one of the LucasArts GUIs, which I believe does what you're asking for? What do you want to do to the Save/Restore GUIs?
I know what you're thinking ... Don't think that.

Joe

Thanks Ashen for your reply,

My modes, USE and GIVE, are the same, the only diferences are:

When I click on USE:{

mouse.Mode=eModeInteract;
SetGlobalInt(50, 1);
}

When I click on GIVE:{

mouse.Mode=eModeInteract;
SetGlobalInt(50, 2);
}

Of course I'd like to "USE" was only for objects or hotspots
and "GIVE" only for characters, but I nearly don't mind.

The interface GUI I want is a text whichs displays what the player is going to do:

Like in LucasArts games, ex: Use scissors with rope
I hope you to understand me :).

Respecting the Save/Restore game dialog, I just wanna know if I can make my custom dialog with a GUI and how can I do it. But if it is going to take you a long time to answer this, i'd prefer you to answer before my question about the interface text.
Copinstar © Oficial Site

Ashen

For the first question:
I'd recommend downloading one of the LEC templates (linked in the first post of the LucasArts GUI help thread - be sure to get the right one for the version of AGS you're using), and copying how they've done it. Probably quicker that someone trying to explain it here, but I'll give it a shot:
Code: ags

//At the top of your GlobalScript
String status;


//This needs to go in your 'repeatedly_execute' function
if (mouse.Mode == eModeUseinv) {
  //When you select an item to use, eModeUseinv will be activated automatically
  if (GetGlobalInt(50) == 1) { // 'Use' item
    status = String.Format("Use %s on @overhotspot@", player.ActiveInventory.Name);
  }
  else if (GetGlobalInt(50) == 2 ) { // 'Give' item
    status = String.Format("Use %s on @overhotspot@", player.ActiveInventory.Name);
  }
}

lblStatus.Text = status;


NOTE: This'll display the message on lblStatus - change it to the scriptname of the Label you want to use. You'll probably also have to add conditions for the other modes (e.g. if (mouse.Mode == eModeWalkto) status = "Walk to @overhotspot@");) - although that could possbly be done when you push the GUI button.
But definately take a look at the templates.

For the second:
Read the first thread I linked to before for some general details, then try either of the links in my reply there for how to actually make a Save/Restore GUI.
I know what you're thinking ... Don't think that.

Joe

Thanks Ashen, i'm really pleased.
I'm looking at the tempates, and I've tried to use your code, I think I'll finally get it, thanks.
Copinstar © Oficial Site

SMF spam blocked by CleanTalk