Forum rules - please read before posting.

Questions regarding triggers in close proximity and 'can carry multiple' items

AC: 1.75.3
Unity: 2019.4.26f1

Hey Chris,

I'm working on a 3D survival horror game called Hollowbody, in the same vein as Silent Hill. As is tradition with this sort of game I am using a lot of dynamic and fixed camera angles switched between using triggers, I also use triggers when near interactions that require the use of inventory items, setting a global variable to true on enter and false on exit.

I've noticed however that sometimes when these triggers are in close proximity they will not always fire off the 'on enter' actionlist and presumably sometimes the exit one too. It's a rare occurrence but does happen occasionally, more so when triggers are in close proximity or intersecting and the character is running.

I was wondering what is the best practice for handling this? I'm using Rigidbody Collision and my triggers are set to Pause Gameplay.

They are typically very simple actionlists, firing off a handful of actions to change camera or set variables with no wait commands so 'pause gameplay' seemed appropriate. Here is a typical trigger setup for changing camera: https://imgur.com/a/LEMVbyT

Regarding my other question, I was wondering if when carrying multiple of an inventory item, is there a way to force AC to display (1) for the numeric value added to the item label when the amount held drops to one. Currently the numeric value is only displayed when holding two of the item or more. Maybe this is achievable by modifying an AC script somewhere?

If it helps, I am talking about this number (shown here as 24) https://i.imgur.com/VFTGSTE.png

--

On a unrelated note, I recently noticed that the 'ActionList: Set Parameter' action allows you to select a parameter value that is an integer whilst also setting the 'Variable' value to a float variable in the same action, this is when copying from a global variable. As far as I can tell from my tests this does not convert the float to int and as a result the parameter value does not get updated. Maybe you've addressed this in a newer AC version but I thought it was worth mentioning :smile:


Thanks!

Comments

  • Welcome back, @Chicky!

    I've noticed however that sometimes when these triggers are in close proximity they will not always fire off the 'on enter' actionlist

    While debugging, begin your ActionLists with ActionList: Comment Actions, which can be used to print logs in the Console. This should help make it clear what exactly is being run, and when.

    If your Triggers are intended to run in the background, set their When running fields to Run In Background. It's hard to say, but it may be that one is blocking another, since the Trigger in your screenshot is set to only run while in gameplay.

    If there's no difference there, what is the result of switching the Detection method to Transform Position? You'll need to ensure your Triggers interesect with the floor to use this.

    when carrying multiple of an inventory item, is there a way to force AC to display (1) for the numeric value added to the item label when the amount held drops to one.

    In your InventoryBox element's properties, set the Display item amounts field to Always.

    the 'ActionList: Set Parameter' action allows you to select a parameter value that is an integer whilst also setting the 'Variable' value to a float variable in the same action, this is when copying from a global variable.

    Apologies, but could you share a screenshot to illustrate this? I'm not quite clear on your meaning.

  • Very helpful, thanks Chris. I suspected the triggers may be blocking one another, I'll try your suggestions and report back if there are still issues.

    Regarding the Set Parameter action, here's an example actionlist:

    https://i.imgur.com/KBGtsh6.png

    As you can see the parameter 'Revolver Ammo Param' is an integer, however the variable Pistol1Ammo is a float. The action lets me set that float alongside the integer parameter but it does not seem to convert the float to an int value. As far as I can tell, this results in the parameter not getting updated.

    I figured if the action is not intended to convert a float variable value to an int parameter it should maybe prevent the user from selecting a float in the 'variable' drop-down?

    Not a huge bug or anything I just thought it was worth mentioning.

  • Understood - thanks for the details.

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.