1"use strict";(self.webpackChunkmy_website=self.webpackChunkmy_website||[]).push([[423],{3035:(e,t,i)=>{i.d(t,{A:()=>s});const s=i.p+"assets/images/T_AbilityQueueInitialSettings-b3362a9bf3701e785d8246eed493b3da.png"},10121:(e,t,i)=>{i.d(t,{A:()=>s});const s=i.p+"assets/images/T_AbilityStateGameplayTagView-b8d16c7f231932a39c362c61d66f2f6c.png"},28453:(e,t,i)=>{i.d(t,{R:()=>l,x:()=>d});var s=i(96540);const n={},a=s.createContext(n);function l(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:l(e.components),s.createElement(a.Provider,{value:t},e.children)}},79347:(e,t,i)=>{i.d(t,{A:()=>s});const s=i.p+"assets/images/T_StartAbilityQueueState-8dcd2f0e744ceb817776b2b641e69dee.png"},91265:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>r,contentTitle:()=>d,default:()=>c,frontMatter:()=>l,metadata:()=>s,toc:()=>o});const s=JSON.parse('{"id":"Ability-Queue-Task-System/AddAbilitiesToTheQueue","title":"Add Abilities to the Queue","description":"We have one task to add our Gameplay Abilities to the queue.","source":"@site/docs/Ability-Queue-Task-System/AddAbilitiesToTheQueue.md","sourceDirName":"Ability-Queue-Task-System","slug":"/Ability-Queue-Task-System/AddAbilitiesToTheQueue","permalink":"/docs/Ability-Queue-Task-System/AddAbilitiesToTheQueue","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_position":3},"sidebar":"tutorialSidebar","previous":{"title":"Startup","permalink":"/docs/Ability-Queue-Task-System/Startup"},"next":{"title":"Use Case Example","permalink":"/docs/Ability-Queue-Task-System/UseCaseExample"}}');var n=i(74848),a=i(28453);const l={sidebar_position:3},d="Add Abilities to the Queue",r={},o=[{value:"Add Ability To Queue Ability Task",id:"add-ability-to-queue-ability-task",level:2},{value:"How to change the current state?",id:"how-to-change-the-current-state",level:4},{value:"Inputs",id:"inputs",level:3},{value:"Queued Ability Settings (Type: <code>FAbilityQueueInitialSettings</code>)",id:"queued-ability-settings-type-fabilityqueueinitialsettings",level:4},{value:"Outputs",id:"outputs",level:3},{value:"On Queue Confirmed",id:"on-queue-confirmed",level:4},{value:"On Queue Canceled",id:"on-queue-canceled",level:4},{value:"On Queue State Changed",id:"on-queue-state-changed",level:4}];function h(e){const t={admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",img:"img",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"add-abilities-to-the-queue",children:"Add Abilities to the Queue"})}),"\n",(0,n.jsxs)(t.p,{children:["We have one task to add our ",(0,n.jsx)(t.code,{children:"Gameplay Abilities"})," to the queue."]}),"\n",(0,n.jsx)(t.h2,{id:"add-ability-to-queue-ability-task",children:"Add Ability To Queue Ability Task"}),"\n",(0,n.jsx)(t.p,{children:"This is the main task that we are going to use."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Add Ability Tp Queue Node",src:i(99482).A+"",width:"1116",height:"454"})}),"\n",(0,n.jsxs)(t.admonition,{type:"warning",children:[(0,n.jsx)(t.mdxAdmonitionTitle,{children:(0,n.jsx)(t.strong,{children:"What we are actually Queuing?"})}),(0,n.jsxs)(t.p,{children:['Although the feature is called "Add Ability To Queue", the system actually queues the ',(0,n.jsx)(t.strong,{children:"Gameplay Ability Task Instance"})," \u2014 ",(0,n.jsx)(t.em,{children:"one task per queue request"}),"."]}),(0,n.jsx)(t.p,{children:"Why this matters:"}),(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Each task is a separate request object, so you can request the same ability multiple times while it is already active."}),"\n"]}),(0,n.jsxs)(t.p,{children:["Eg. ",(0,n.jsx)(t.em,{children:"Light Attack after another Light Attack."})]}),(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Tasks carry their own parameters and lifetime, letting each queue entry behave independently (useful for combos or repeated inputs)."}),"\n"]}),(0,n.jsxs)(t.p,{children:["When to use it: call ",(0,n.jsx)(t.em,{children:"Add Ability To Queue"})," from input handlers or gameplay events to request activation. If you need to stop a pen
1ding request, cancel or end the task before it reaches activation."]}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.em,{children:"We will see more examples on the following pages."})})]}),"\n",(0,n.jsx)(t.h4,{id:"how-to-change-the-current-state",children:"How to change the current state?"}),"\n",(0,n.jsxs)(t.p,{children:["Store the ",(0,n.jsx)(t.code,{children:"Add Ability To Queue"})," Gameplay Task in a variable when you create it. To update that queued request, call ",(0,n.jsx)(t.code,{children:"Start AbilityQueueState"})," on the task and pass the new state tag \u2014 the task will update its priority in the queue when its state changes."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"StartAbilityQueueState",src:i(79347).A+"",width:"1074",height:"399"})}),"\n",(0,n.jsx)(t.p,{children:"Examples"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["Animation notifies: fire gameplay events from montage notifies to set ",(0,n.jsx)(t.code,{children:"Initial"}),", ",(0,n.jsx)(t.code,{children:"Apex"}),", ",(0,n.jsx)(t.code,{children:"Recovery"})," as the animation plays."]}),"\n",(0,n.jsxs)(t.li,{children:["Input flow: on input release or hold-time expiration set the task to a ",(0,n.jsx)(t.code,{children:"Recovery"})," or ",(0,n.jsx)(t.code,{children:"Hold"})," state."]}),"\n",(0,n.jsxs)(t.li,{children:["Gameplay events: on hit, stagger, or combo conditions set the task to ",(0,n.jsx)(t.code,{children:"Apex"}),", ",(0,n.jsx)(t.code,{children:"Combo"}),", or another relevant state."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"You can trigger state changes from the ability's Blueprint (ability event graph), from the task variable stored on the ability, or from any system that has access to the owner of this ability."}),"\n",(0,n.jsx)(t.h3,{id:"inputs",children:"Inputs"}),"\n",(0,n.jsxs)(t.h4,{id:"queued-ability-settings-type-fabilityqueueinitialsettings",children:["Queued Ability Settings (Type: ",(0,n.jsx)(t.code,{children:"FAbilityQueueInitialSettings"}),")"]}),"\n",(0,n.jsx)(t.p,{children:"This is and example of the Queue Settings:"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"AbilityQueueInitialSettings",src:i(3035).A+"",width:"526",height:"238"})}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameter"}),(0,n.jsx)(t.th,{children:"Type"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.strong,{children:"Available Queue States"})}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)(t.code,{children:"FQueueTaskStateData"})," (struct)"]}),(0,n.jsxs)(t.td,{children:["A map of ability state tags \u2192 priority integers. ",(0,n.jsx)(t.code,{children:"The first entry in the map is treated as the *Initial State*"})," (the state that starts automatically when the ability is activated from the queue and is used to compute the ability's queue priority). Higher numbers = higher priority."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.strong,{children:"Queue Lifetime"})}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)(t.code,{children:"float"})," (seconds)"]}),(0,n.jsxs)(t.td,{children:["How long (in seconds) this queued request can stay in the queue before it is automatically removed. Default: ",(0,n.jsx)(t.code,{children:"1.0"}),". (Minimum 0.0.)"]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.strong,{children:"Auto Commit Ability"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"bool"})}),(0,n.jsxs)(t.td,{children:["When true the ability will attempt to automatically commit when activated from the queue. This requires the ability's ",(0,n.jsx)(t.code,{children:"CommitCheck()"})," to succeed. When auto-commit is true, ",(0,n.jsx)(t.code,{children:"OnQueueConfirmed"})," will be invoked shortly after commit (similar timing to ",(0,n.jsx)(t.code,{children:"OnCommitExecute"}),"). When false you must commit manually if needed. For example if character does not have the required stamina, commit check will fail, and ability won't even be the playing ability."]})]})]})]}),"\n",(0,n.jsxs)(t.p,{children:["Defining your ",(0,n.jsx)(t.code,{children:"Ability Queue States"})," as general is possible is helpful to divide your abilities into logical segments. Like ",(0,n.jsx)(t.em,{children:"Startup, Apex, Recovery"}),". Because when the ability state gets changed, ability's priorty gets changed too. And you can bind your State Changing events to the different gameplay events in your game. Such as ",(0,n.jsx)(t.em,{children:"When Reached Main State, consume stamina"})," etc."]}),"\n",(0,n.jsxs)(t.admonition,{type:"tip",children:[(0,n.jsx)(t.mdxAdmonitionTitle,{children:(0,n.jsx)(t.strong,{children:"Creating Your Ability State Gameplay Tags"})}),(0,n.jsxs)(t.p,{children:["If you define your Gameplay Tags with prefix: ",(0,n.jsx)(t.code,{children:"AbilityState"})," on the project settings, gameplay tag selection will only display the tags under the ",(0,n.jsx)(t.em,{children:"Ability State"}),"."]}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Ability State Gameplay Tag View",src:i(10121).A+"",width:"858",height:"357"})})]}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h3,{id:"outputs",children:"Outputs"}),"\n",(0,n.jsx)(t.h4,{id:"on-queue-confirmed",children:"On Queue Confirmed"}),"\n",(0,n.jsxs)(t.p,{children:["Called whenever the task is now the ",(0,n.jsx)(t.em,{children:"Playing Task"}),". If you had ticked the ",(0,n.jsx)(t.code,{children:"Auto Commit Ability"})," on the ",(0,n.jsx)(t.code,{children:"Queued Ability Settings"})," when this gets triggered ability will be commited too. (So you could just use the ",(0,n.jsx)(t.code,{children:"Event CommitExecute"})," on the actual Gameplay Ability.)"]}),"\n",(0,n.jsx)(t.h4,{id:"on-queue-canceled",children:"On Queue Canceled"}),"\n",(0,n.jsx)(t.p,{children:"Called when the ability was removed from the queue without being activated. This can happen if the ability was cancelled or the queue lifetime had expired or if another ability with higher priority was added to the qeueue."}),"\n",(0,n.jsx)(t.admonition,{type:"note",children:(0,n.jsxs)(t.p,{children:["If the Ability was playing but cancelled beacuse of another ability took it's place, ",(0,n.jsx)(t.code,{children:"On Queue Canceled"})," won't get fired. ",(0,n.jsx)(t.strong,{children:"Instead the abiliy was playing will be cancelled."})]})}),"\n",(0,n.jsx)(t.h4,{id:"on-queue-state-changed",children:"On Queue State Changed"}),"\n",(0,n.jsxs)(t.p,{children:["Called wheneverthe ability's state is changed while it is currently the playing ability on the ",(0,n.jsx)(t.code,{children:"Ability Queue Manager"}),". Ability States are changed by calling ",(0,n.jsx)(t.code,{children:"Start Ability Queue State"}),"."]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.em,{children:"New State"}),": Is now the active state"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.em,{children:"Old State"}),": Previous State that was active (FGameplayTag::Empty if there was no prior state)."]}),"\n"]}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.p,{children:"That is how you add your abilities to the queue! You are now ready to create your own queueable abilities. But there are few tricks and examples that I can show you in the following pages."})]})}function c(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},99482:(e,t,i)=>{i.d(t,{A:()=>s});const s=i.p+"assets/images/T_AddAbilityToQueueNode-5df46c8c27687bc43e7fd14f995d576d.png"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.