Jump to content
⚠ Known Issue: Media on User Profiles ×

Question of probability


pasmon79

Recommended Posts

When using multiple nested alts like the one that delivers random weapon in Lifeline, can we reuse a single AltID like "FailSafe"(as an example only) under the same "fsevent" or even within the same "Enclave"(Alts belonging to different ActionID) multiple times as long as input conditions are satisfied.

Edited by pasmon79
Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Ok, I think you mean Event Id="Lifeline.RandomWeapon" ?

 

As long as there is only one copy of the FailSafe alt under each level it should work fine, but for readability purposes I'd change the name slightly. If you need to go back and adjust, that makes it much easier to keep track of where you are.

 

Some of those lists are not set up correctly though. Several have the last two options set at 100... which means the first of them will always be selected and the last never gets considered.

"Alt" ActionId="SelectWeapon1" is correct

"Alt" ActionId="SelectWeapon2", "Alt" ActionId="SelectWeapon3", "Alt" ActionId="SelectWeapon4", and in fact 3 and 4 have two weapons each that will never be seen.

Link to comment
Share on other sites

What i mean is that can one copy of an "ALTID" Action under only one level can be used by other levels without pasting multiple copies under each level.

 

For example

<Action....ActionFlag="repeats"...ActionID="A"
  AltID BCD
</Action>  
<Action....ActionFlag="ALT"..ActionID="BCD"
</Action>
<Action..ActionFlag="repeats"....ActionID="B"
  AltID BCD
</Action> 

In this example, can ActionID="B" can re-use "BCD" used by ActionID="A" without pasting the same piece of code below it?

Edited by pasmon79
Link to comment
Share on other sites

Ah, no, that won't work. It does need to be included in each level it will affect.

 

You could combine them together into one large group. In that example, combining the lists from SelectWeapon1,SelectWeapon2,SelectWeapon3,SelectWeapon4 into one large set of alts, and then putting the resulting actions and the failsafe together would work.

Link to comment
Share on other sites

In the code below, both "A" and "B" now uses "BCD" that is defined only once but used by both.

<Action....ActionFlag="repeats"...ActionID="A"
  AltID BCD
</Action> 
<Action..ActionFlag="repeats"....ActionID="B"
  AltID BCD
</Action> 
<Action....ActionFlag="ALT"..ActionID="BCD"
</Action> 

Is this allowable, Afterall "EstablishSandboxCharacetrs"(A subaction) works on the similar principle that is it is called both by "Enclaves" created in close proximity and the one created anyware.

<Action ActionFlags="" ActionId="Establish_SandboxGeneric_Close" ActionType="Action.Establish" ExecuteTimeStandard="0.0" OutputDelayTime="0.0" PauseWhenOffline="">
        <RTSActionIcon Name="" Id="" />
        <NameText Flags="" Notes="" Text="" />
        <Actors>
          <Enclave ActorFlags="" ActorName="Enclave.Home_Sandbox" EnclaveStat="" HideWarnings="" Optional="" />
          <Building ActorFlags="" ActorName="" BuildingFlagsMask="Outpost, Enclave, Outdoor, Tiny, MissionOp, Entered, SearchActivity, HasBarricades" BuildingFlagsQuery="HasBarricades" HideWarnings="" NearActorIdx="0" Optional="" SearchRangeMax="400" SearchRangeMin="30.0" SiteTag="" />
        </Actors>
        <Alts />
        <Effects />
        <Inputs>
          <CheckBool InputFlags="" InputId="Sandbox.Scenario.FirstPhase" Invert="" />
        </Inputs>
        <Outputs>
          <Enclave_ClaimSite EnclaveIndex="" SiteIndex="1" />
          <ExecuteAction ActionId="Establish_SandboxGeneric_Characters" />
        </Outputs>
      </Action>
      <Action ActionFlags="" ActionId="Establish_SandboxGeneric_Anywhere" ActionType="Action.Establish" ExecuteTimeStandard="0.0" OutputDelayTime="0.0" PauseWhenOffline="">
        <RTSActionIcon Name="" Id="" />
        <NameText Flags="" Notes="" Text="" />
        <Actors>
          <Enclave ActorFlags="" ActorName="Enclave.Home_Sandbox" EnclaveStat="" HideWarnings="" Optional="" />
          <Building ActorFlags="" ActorName="" BuildingFlagsMask="Outpost, Enclave, Outdoor, Tiny, MissionOp, Entered, SearchActivity, HasBarricades" BuildingFlagsQuery="HasBarricades" HideWarnings="" NearActorIdx="0" Optional="" SearchRangeMax="16000.0" SearchRangeMin="30.0" SiteTag="" />
        </Actors>
        <Alts />
        <Effects />
        <Inputs>
          <CheckBool InputFlags="" InputId="!Sandbox.Scenario.FirstPhase" Invert="" />
        </Inputs>
        <Outputs>
          <Enclave_ClaimSite EnclaveIndex="" SiteIndex="1" />
          <ExecuteAction ActionId="Establish_SandboxGeneric_Characters" />
        </Outputs>
      </Action>
      <Action ActionFlags="Subaction" ActionId="Establish_SandboxGeneric_Characters" ActionType="Action.Establish" ExecuteTimeStandard="0.0" OutputDelayTime="0.0" PauseWhenOffline="">
        <RTSActionIcon Name="" Id="" />
        <NameText Flags="" Notes="" Text="" />
        <Actors>
          <Character ActorFlags="Spawn" ActorName="" ActorTask="" ActorTraits="Trait.Voice.Playable, !Trait.Immune.NonStoryContent" FunctionTags="" HideWarnings="" Optional="" TargetEnclave="" />
          <Character ActorFlags="Spawn" ActorName="" ActorTask="" ActorTraits="Trait.Voice.Playable, !Trait.Immune.NonStoryContent" FunctionTags="" HideWarnings="" Optional="" TargetEnclave="" />
          <Character ActorFlags="Spawn" ActorName="" ActorTask="" ActorTraits="Trait.Voice.Playable, !Trait.Immune.NonStoryContent" FunctionTags="" HideWarnings="" Optional="" TargetEnclave="" />
        </Actors>
        <Alts />
        <Effects />
        <Inputs />
        <Outputs>
          <Actor_JoinEnclave ActorIndex="0" EnclaveIndex="" />
          <Actor_JoinEnclave ActorIndex="1" EnclaveIndex="" />
          <Actor_JoinEnclave ActorIndex="2" EnclaveIndex="" />
          <Actor_GiveTrait ActorIndex="0" DuringMission="" OutputDuration="" PauseWhenOffline="" Trait="Trait.Enclave.Leader" />
          <ExecuteAction ActionId="ChooseState" />
        </Outputs>
      </Action>
Edited by pasmon79
Link to comment
Share on other sites

For "Establish_SandboxGeneric_Characters", it works because it is called via ExecuteAction instead of as an ALT action. The difference is that it is defined as a subaction instead of an ALT, and must be called from inside each action that will require it.

 

<Action ActionFlags="Subaction" ActionId="Establish_SandboxGeneric_Characters"

 

If the ActionFlag was an <Action ActionFlags="Alt" it must be in the same block as the Action that calls it.

 

Subactions can be outside the block, within the same file, but have to be called specifically.

 

This is similar to <EventTrigger Event= which calls to rtsevents.

 

So in that case, your code block example:

 

<Action....ActionFlag="repeats"...ActionID="A"
AltID BCD
</Action>
<Action..ActionFlag="repeats"....ActionID="B"
AltID BCD
</Action>
<Action....ActionFlag="ALT"..ActionID="BCD"
</Action>

 

would not work, but it would if done as

 

<Action....ActionFlag="repeats"...ActionID="A"
<ExecuteAction ActionId="BCD"
</Action>
<Action..ActionFlag="repeats"....ActionID="B"
<ExecuteAction ActionId="BCD"
</Action>
<Action....ActionFlag="subaction"..ActionID="BCD"
</Action>

 

If you still had multiple ALTS within the Action blocks, each one would need to include the ExecuteAction call.

Edited by qmjs
Link to comment
Share on other sites

Gee, Thanks for useful info. That explains a lot about crashing i have been seeing in my modification of game.

 

In the foraging list, you have mentioned that it is a conditional list.

<Alts>
<Alt AltId="Foraging_15" AltOdds="100.0" />
<Alt AltId="Foraging_13" AltOdds="100.0" />
<Alt AltId="Foraging_11" AltOdds="100.0" />
<Alt AltId="Foraging_9" AltOdds="100.0" />
<Alt AltId="Foraging_7" AltOdds="100.0" />
</Alts>

If i understand it correctly, for a population of 15, all the conditions are satisfied but in actual only the top one is executed implying that it behaves like a "case" switch similar to C++,i.e. once a condition is satisfied, it exits the "Alt loop" immediately and do not execute the remaining ones.

Edited by pasmon79
Link to comment
Share on other sites

That is correct. When an action that has Alts runs, it checks the first one in the list. AltOdds is the chance that the Alt is selected, and if the input conditions are met it runs. If either fails (percentage check or input conditions), it then moves to the next one and checks it. If all Alts fail to run, the base action is then checked for input conditions.

 

It is possible for all Alts and the main Action to not run if the input conditions are not met.

Link to comment
Share on other sites

The unique thing about Alt List dedicated to foraging and Scenario Count Check for RV is that AltOdd can satisfy all given conditions with large population and high scenario but it will only execute the first one only despite satisfying all others.

Link to comment
Share on other sites

Yes, but within an action, only one will run... once an Alt does run, the entire action is exited, so you will only get one result from each block of action and alts each time it is called.

 

Foraging_15 has 100% chance to run, so inputs are checked... if 15 labor it runs and you get 11 food and the entire action exits. Less than 15 labor and it fails the inputs and moves to the next alt.

 

Foraging_13 then has 100% chance to run, so inputs are checked... if 13 labor it runs and you get 10 food and the entire action exits. Less than 13 labor and it fails the inputs and moves to the next alt.

 

This continues through foraging_11, foraging_9, and foraging_7. If foraging_7 fails, it then goes to he parent action, ActionId="Foraging"

 

This one has no inputs, so it will automatically run, but it has no outputs, so you don't get anything from it.

 

The best result is first, and each gets weaker as it moves down the list and you have less people available to forage... so you get less food found.

Edited by qmjs
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...