Forum rules - please read before posting.

Trying to setup inventory action to work with "player vicinity" hotspot detection method

Sorry for the weird wording in the title. I'm trying to make a specific thing work with AC, and would like some guidance.

1. The game is 2D, direct controlled, using keyboard/ controller as the input method. I'm using the Walking Dead template as of now to make this work. I've set it up in such a way that when near a hotspot, I press "E" to open up the interaction wheel, and then I press either left arrow for "talk", right arrow for "look at", and down arrow for "use". I'd like to set it up so that up arrow activates the inventory interaction. The player will only carry one inventory item at a time, so this needs to be only one key and icon. 
The existing inventory menu doesn't have the "alternative input button" field where I can enter this. I'd also like to add another such menu (to "think about" stuff) but new buttons don't have that field either. Any tips? 

imageimageimage


2. Also, at times there are two hotspots above/ below or next to each other. (For example the car and the shop sign above are both hotspots) How do I allow the player to choose/ select one of them? 


I'm still trying to figure this out on my own, but don't seem to be making much progress. It'd be great if someone could point me in the right direction :) Thanks!

Comments

  • 1. I'll look into allowing the "Alternative input button" field showing for the special case of single-slot hotspot-based inventory elements, but in the meantime this can be done by creating an "invisible" button that runs an ActionList when it's own "Alternative input button" is pressed.  This would then run a script that simulates the pressing of the Inventory element:

    AC.PlayerMenus.SimulateClick ("MyMenu", "MyInventoryBox");

    Is your "think about stuff" mechanic going to use another inventory, or another cursor/verb icon?

    2. Set the "Hotspots in vicinity" to "Cycle Multiple", and you'll then be able to define CycleHotspotsLeft / CycleHotspotsRight input buttons to cycle through Hotspots when multiple are detected.  See the "Player-vicinity detection" chapter of the Manual for more.
  • edited November 2017
    1. Alright, here's what I did. Followed your instructions without understanding them completely so I might have misinterpreted some things:

    In the menu manager, Interaction menu, made a new button in the "interaction elements" section. Unchecked "is visible?" and click type : Run action list. Created an action list and copy pasted the code that you gave (not sure if it had to be edited?) into a duplicate of the "ActionTemplate" file. Set the inventory action list to run this custom script. Added a new field "Icon_inventory" in the input manager and set the positive button as "up" 
    I also went into the cursor manager and created a new icon (icon ID 3) and labelled it "inventory" 

    image

    The "think about" would be an icon like look at/ talk to/ cursor icon. 

    2. I actually thought more about it, and changed this at a game design level. I thought it'd be more streamlined to not have to cycle between hotspots, so I'm positioning them in such a way that there's only one hotspot to interact with at a time. The car hotspot exists only around its windows, and the shop sign hotspot I've placed near the car's front wheel.
  • 1. If the Is visible? toggle is checked, it won't work - it needs to be visible but hidden from view (e.g. with zero size).  However, I'll be adding the feature I mentioned in the next update which will be out soon.

    New icons can be added in the Cursor Manager.  Once defined, they can then be selected in Interaction elements.
  • Cool! Think I'll wait for the update and see if that works for me. Any approximate ETA for it? Also was wondering if I pasted the code correctly for the script.

    Thanks!
  • It'll be out this week.

    Any custom Action needs to have the actual "perform" code (in this case, the SimulateClick call) in it's Run function.  The code you posted shows it in ShowGUI, which - as the comment shows - is used for the actual user-interface in the Inspector / ActionList Editor.

    A tutorial on writing custom Actions can be found here.
  • I shall try it out after the update. Thanks as always :)
  • Hey @chrisicebox

    I noticed that the update came with the new inventory feature, from reading the release log. I tried accessing this inventory function, but the "alternative input button" didn't show up when I changed the number of slots to one.

    Here's a picture of my attempt. I copy pasted the existing inventory function to the interaction menu, to put it alongside use, look and talk to functions.

    imageimage
  • It should be appearing right underneath the "Only show items referenced in Interactions?" toggle.

    Did you import the complete package?  What version is shown when you go to "Adventure Creator -> About" in the top toolbar?
  • v1.60.2 It says 1.60.4 is now available. I shall import that and let you know how it goes.
  • @chrisicebox ; Imported the new update and it works perfectly. Thanks for adding in this feature Chris! :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.