Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Guest

Retail
Displaying The Host In The Message Feed

19 posts in this topic

In this tutorial, I will show you how to display the host's gamertag in the killfeed at the beginning of the round. We are assuming that the first player to spawn is the host. I'm unable to confirm whether the player with the index of 0 is always the host, but this method seems to be pretty accurate.

 

You will need to create a global player variable like so:

 

   <GlobalVariables>      <Players>        <Var networkState="HighPriority" name="GlobalPlayer0" />      </Players>    </GlobalVariables>
 

 

If your gametype doesn't have the incident trigger, then you will need to add one. In the incident trigger, add the following code:

 

         <E type="Action" name="Branch">            <Param type="VirtualTrigger">              <VT type="VirtualTrigger">                 <!-- Condition: Did a player just spawn? -->                <E type="Condition" name="Incident" unionGroupID="-2">                  <Param type="IncidentIdRef">player_spawn</Param>                </E>                 <!-- Condition: AND the host player variable is empty? -->                <E type="Condition" name="Comparison" unionGroupID="-2">                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="GlobalPlayer0" />                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="NONE" />                  <Param type="ComparisonType">Equal</Param>                </E>                 <!-- Get a reference to the player whom just spawned -->                <E type="Action" name="IncidentGetCausePlayer">                  <Param type="PlayerReference" varRefType="ExplicitPlayerType" dataType="PlayerScratch0" />                </E>                 <!-- Store this reference to the global variable -->                <E type="Action" name="VariableOperation">                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="GlobalPlayer0" />                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="PlayerScratch0" />                  <Param type="OperationType">Set</Param>                </E>                 <!-- Display the message in the killfeed -->                <E type="Action" name="ChudMessage">                  <Param type="TargetVar" targetType="None" />                  <Param type="SoundIndex">NONE</Param>                  <Param type="Tokens2" stringIndex="%s is the host" tokenCount="1">                    <Token0 type="Player" varRefType="ExplicitPlayerType" dataType="GlobalPlayer0" />                  </Param>                </E>               </VT>            </Param>          </E>
 

 

Now, to avoid having the message display again (most likely incorrectly) after a host migration, you will need to add a HostMigration trigger if the gametype does not have one already. In the trigger, add the following:

 

         <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="GlobalPlayer0" />            <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="Player0" />            <Param type="OperationType">Set</Param>          </E>

What this does is ensure the host variable has a reference to a player so the message won't be displayed again after a host migration. I'm not sure how to get a reference to the host after a host migration.

Share this post


Link to post
Share on other sites

Thats awesome. Your reckon there is anyway we can use this to get player inputs? I guess we still need a way to get local players though...

Share this post


Link to post
Share on other sites

Thats awesome. Your reckon there is anyway we can use this to get player inputs? I guess we still need a way to get local players though...

That's a problem I'm currently trying to figure out. It's what was preventing the descope mod from being fully functional.

Share this post


Link to post
Share on other sites

Well are you sure that Direct Player0 is the host? Because I would assume that player0 is the first local player, so therefore different on each console...

Share this post


Link to post
Share on other sites

Well are you sure that Direct Player0 is the host? Because I would assume that player0 is the first local player, so therefore different on each console...

Oh sorry for the confusion. I said it most likely wasn't the host. The reason why I used Player0 in the host migration trigger is to avoid the host variable from holding a value of null since the host is no longer in the game. This will cause the wrong host to be displayed to all players after a migration.

And I doubt it's the local player since there are 16 direct player references Player0 to Player15.

Share this post


Link to post
Share on other sites

KSoft says that "HostPlayer" is not a valid name in PlayerType :(

 

I assume that KSoft's Definitions might need an update before we can encode this.

Share this post


Link to post
Share on other sites

KSoft says that "HostPlayer" is not a valid name in PlayerType :(

 

I assume that KSoft's Definitions might need an update before we can encode this.

Alright, thanks for letting me know. Try GlobalPlayer0 (or other number if it's taken).

Share this post


Link to post
Share on other sites

Well are you sure that Direct Player0 is the host? Because I would assume that player0 is the first local player, so therefore different on each console...

 

Standard (non-local) triggers are only run on the host. Player 0 is logically the first local player to join the game, and since the code is getting executed on the host, then player 0 is the host at the start of the game. If a host migration occurs, though, this rule becomes invalid.

Share this post


Link to post
Share on other sites
Ive tried this playing local ie (playing a custom ffa by myself) and its not working. is this because im the host so it wont display the message or does it just not work local? 
 
EDIT: also tested it online with friends and not working
 
forgive for being a noob but isnt your  script missing a string
 
<String name="%s is the host">        <String>%s is the host</String>      </String>

maybe thats why its not displaying? i have the decope variant open along side my variant tryign to figure out what could be wrong.

 

 
anyway heres my ffa variant ive implemented it to. have i done this correct?
 
Edited by PjMpire

Share this post


Link to post
Share on other sites

@Matt, can confirm this is now working,

 

missing string is 

<String name="%s is the host">        <String>%s is the host</String>      </String>

:biggrin:

Share this post


Link to post
Share on other sites

Standard (non-local) triggers are only run on the host. Player 0 is logically the first local player to join the game, and since the code is getting executed on the host, then player 0 is the host at the start of the game. If a host migration occurs, though, this rule becomes invalid.

 

Yeh but you could deal with that by sticking in a trigger on a host migration entry point. To re-configure it.

Share this post


Link to post
Share on other sites

Yeh but you could deal with that by sticking in a trigger on a host migration entry point. To re-configure it.

 

Nope, doesn't work like that because then the host won't have been the first player to join the game.

Share this post


Link to post
Share on other sites

The host display is very inconsistent, has been played in over 100 customs in europe and the feedback im getting is the same.

 

host message seems to be different each game. Futher proven by the host player displayed isnt getting red ring around ordnance drops.

 

heres my modded eu competitive settings in action now. the 2 top teams in europe scrimming with the host display implemented.

 

http://www.twitch.tv/smithyyyyy9

Edited by PjMpire

Share this post


Link to post
Share on other sites

Hmm, that sucks. That might explain why my descope mod didn't work. I'll take a look later tonight and see if I can find a better way of doing it. You can try the following code instead:

         <E type="Action" name="Branch">            <Param type="VirtualTrigger">              <VT type="VirtualTrigger">                 <!-- Condition: Did a player just spawn? -->                <E type="Condition" name="Incident" unionGroupID="-2">                  <Param type="IncidentIdRef">player_spawn</Param>                </E>                 <!-- Condition: AND the host player variable is empty? -->                <E type="Condition" name="Comparison" unionGroupID="-2">                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="GlobalPlayer0" />                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="NONE" />                  <Param type="ComparisonType">Equal</Param>                </E>                 <!-- Store Player0 to the global variable -->                <E type="Action" name="VariableOperation">                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="GlobalPlayer0" />                  <Param type="VarReference" varRefKind="Player" varRefType="ExplicitPlayerType" dataType="Player0" />                  <Param type="OperationType">Set</Param>                </E>                 <!-- Display the message in the killfeed -->                <E type="Action" name="ChudMessage">                  <Param type="TargetVar" targetType="None" />                  <Param type="SoundIndex">NONE</Param>                  <Param type="Tokens2" stringIndex="%s is the host" tokenCount="1">                    <Token0 type="Player" varRefType="ExplicitPlayerType" dataType="GlobalPlayer0" />                  </Param>                </E>               </VT>            </Param>          </E>

Share this post


Link to post
Share on other sites

@Matt i was looking into your descope mod, i decoded the variant and had a mess around. tried to re encode it and got errors with ksoft.

 

so then I tried decoding the variant and then re encoding it straight after and i still get errors. whats up with that? problem seems specific to your gametype.

Edited by PjMpire

Share this post


Link to post
Share on other sites

@Matt i was looking into your descope mod, i decoded the variant and had a mess around. tried to re encode it and got errors with ksoft.

 

so then I tried decoding the variant and then re encoding it straight after and i still get errors. whats up with that? problem seems specific to your gametype.

I don't use ksoft to make gametypes and ksoft has a lot of error checking (even more than Halo 4 in-game). I'm sorry I can't help you out with that.

So in every other Halo game the host was always the one that spawned first?

Yes, and it's supposed to be the same in Halo 4. It seems as if the Megalo engine synchronizes incidents.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0