Adventure Creator Wikia
Explore
Main Page
Discuss
All Pages
Community
Interactive Maps
Recent Blog Posts
Popular pages
Most visited articles
Custom Action - Variable: MultiBoolCheck
General
Scrolling text and Scrolling text audio.
Cancel Interaction Menus
Adding image effects
Custom trigger (triggers one actionlist when entering and another when exiting)
Randomize speech audio (Random Syllables)
Use items on an AC Character
Running Animations when game is paused
Integrations
CNControls Integration (Virtual Joystick)
Rewired integration
Unity analytics Integration (AC Action)
FinalIK Interactions Integration (AC Action)
Rogo Lipsync (No audio) 01 - Play Action
Rogo Lipsync (No audio) 02 - Stop Action
Rogo Lipsync (No audio) 03 - Set Emotion Action
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Adventure Creator Wikia
192
pages
Explore
Main Page
Discuss
All Pages
Community
Interactive Maps
Recent Blog Posts
Popular pages
Most visited articles
Custom Action - Variable: MultiBoolCheck
General
Scrolling text and Scrolling text audio.
Cancel Interaction Menus
Adding image effects
Custom trigger (triggers one actionlist when entering and another when exiting)
Randomize speech audio (Random Syllables)
Use items on an AC Character
Running Animations when game is paused
Integrations
CNControls Integration (Virtual Joystick)
Rewired integration
Unity analytics Integration (AC Action)
FinalIK Interactions Integration (AC Action)
Rogo Lipsync (No audio) 01 - Play Action
Rogo Lipsync (No audio) 02 - Stop Action
Rogo Lipsync (No audio) 03 - Set Emotion Action
Editing
Limiting the times an ActionList can run
Back to page
Edit
Edit source
View history
Talk (0)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
This script lets you set the number of times a scene-based ActionList (i.e. a Cutscene / Interaction / Trigger) can be run. If the limit has been exceeded, an alternative ActionList can be run in its place. To use it: # Create a new C# script named ActionListRepeater.cs, and paste in the code below # Attach the new "Action List Repeater" component to the scene-based ActionList you wish to limit # In its Inspector, set its "Repeatable Amount" value and (optionally) an "ActionList On Fail". ActionListRepeater.cs: using UnityEngine;<br> using AC;<br> <br> public class ActionListRepeater : MonoBehaviour<br> {<br> <br> public int repeatableAmount = -1;<br> public ActionList actionListOnFail;<br> private int timesPlayed;<br> <br> <br> private void OnEnable ()<br> {<br> EventManager.OnBeginActionList += OnBeginActionList;<br> }<br> <br> <br> private void OnDisable ()<br> {<br> EventManager.OnBeginActionList -= OnBeginActionList;<br> }<br> <br> <br> private void OnBeginActionList (ActionList actionList, ActionListAsset actionListAsset, int startingIndex, bool isSkipping)<br> {<br> if (repeatableAmount >= 0 && actionList == GetComponent <ActionList>())<br> {<br> if (timesPlayed > repeatableAmount)<br> {<br> actionList.Kill ();<br> if (actionListOnFail) actionListOnFail.Interact ();<br> return;<br> }<br> <br> timesPlayed ++;<br> }<br> }<br> <br> } [[Category:General]]
Summary:
Please note that all contributions to the Adventure Creator Wikia are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab