Use MI/Thimbleweed Park style actions

Started by Tavish, Wed 23/12/2020 13:07:22

Previous topic - Next topic

Tavish

Hi,
I'm new to AGS obviously, I also know nothing about coding, except what I've seen and copied in tutorials.
I've watched densming's tutorials (and others) but he doesn't use the MI/thimbleweed inteface.
I've searched here and haven't found what I'm looking for.

I can't figure out how to use the actions "open" "close" "push" "pull" in game.
I know it has something to do with Usermode1 and usermode 2 in hotpots events but I have found no tutorial on it.
I assigned them to make the player say something just to try it out and well he does when I click on any of those 4 actions

basically I just want to make a cupboard/door/window that I can open and close as much as I want, with objects inside I can pick up. I allready have the sprites to try it out.
I feel so stupid about asking this, it seems like something that anyone using AGS would know how to do, but for the life of me I'm completely lost.

Sorry if this is obvious to anyone here, but I would be gratefull if someone could help me out, or point me to a tutorial I might've missed.
Thanks!


Danvzare

I remember when I first started using AGS.
After going through the tutorial that came with the manual, I loaded up a 9-verb template and tried to make my first game.
I managed to figure out how to use all of the verbs, by simply looking at how it was done in the example room in the template. No tutorial necessary. I learnt it myself. I then proceeded to learn more and more. It took me waaaaaaaay too long to figure out how to make a functioning door though.

But it's time to stop reminiscing and be helpful.
I've got the 9-verb MI-style template here, so this advice might not be perfect. I don't know if you're using the Tumbleweed template, or if that's any different.
Firstly, look at the room scripts in the template. They should give you all of the examples you need to do anything and everything.
Secondly, looking at it the room script in mine shows this:
Code: ags
function cup_AnyClick()
{
  if (MovePlayer(108, 100)) {
    // LOOK AT
    if(UsedAction(eGA_LookAt)) {
      player.Say("It's a blue cup.");
    }
    // USE
    else if(UsedAction(eGA_Use)) {
      player.Say("I'd rather pick it up.");
    }
    // Push
    else if(UsedAction(eGA_Push)) {
      player.Say("It might break.");
    }
    // Pull
    else if(UsedAction(eGA_Pull)) {
      Unhandled();
    }  
    // PICKUP
    else if(UsedAction(eGA_PickUp)) {
      player.Say("Okay.");
      any_click_walk_look_pick(108, 100, eDirectionUp, "You are now mine.",oCup.ID, iCup);
    }
    //USE INV
    else if(UsedAction(eGA_UseInv)) {
      Unhandled();
    }
    // don't forget this
    else Unhandled();
  }
}

Which I think is pretty self explanatory.
You just need to use a bunch of else ifs, which include UsedAction(eGA_Open), UsedAction(eGA_Close), UsedAction(eGA_Push), and UsedAction(eGA_Pull), to be able to recognize when those verbs are used on something.

Crimson Wizard

#2
Not sure if you already tried to use right template or starting on your own, there is a template called "Tumbleweed" in current version of AGS that has this kind of UI. (In older versions it was called "MI 9-verb template")

MI / Tumbleweed templates come with their own manual in a form of PDF. It's copied to your game's folder.
There also must be a section in AGS manual with similar or same content (you may call offline AGS manual by pressing F1 in your Editor, or opening ags-help.chm file in editor's folder).
Online version: https://github.com/adventuregamestudio/ags-manual/wiki/Tumbleweed


If you are using this template, main points, or TL;DR :

* use only Pointer cursor mode, no other cursor modes necessary, so ignore them.
* for game objects create functions only for "Any click"/"Other click" events.
* inside these "any click" events make a big switch where you check which custom verb from template player used. See Danvzare's example script above, or script found within template's sample rooms.
* if you want more verbs / different verbs, there must be a way to put them into template's scripts.
For example, list of possible actions is in "enum Action" (found in VerbGUI script).
Binding action to GUI button is done using Verbs.SetActionButton function.


If you want to write your UI complete from scratch, that's a very much different problem...

Khris

#3
I'm reiterating this, because it's the single most important sentence:

MI / Tumbleweed templates come with their own manual in a form of PDF. It's copied to your game's folder.

OP probably just missed it.

Tavish: AGS event handling is primarily built around early Sierra-type games that use a bunch of cursor modes. The Thumbleweed template is completely custom-made, and uses a different system. It is explained in detail in the PDF that comes with it.

Note that the current version's functions all start with  Verbs.*

Tavish

Thanks all of you for anwsering.
I had NO IDEA there was a pdf manual inside the game folder, I'll check it out and try to understand it.
Again, many thanks.

SMF spam blocked by CleanTalk