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
7ime

Retail
Object Scaling

7 posts in this topic

Please note that this tutorial is not written using the newest version of KSoft but the old repack version, although should work with .5040 also.

 

Explanation courtesy of OrangeMohawk:  

"Set the "scale" object filter on the items you want affected. The scale percentage will be determined by 10 times the spawn sequence number plus 100."

So if you set the spawn sequence to 1 the object will be 110% it's original size while a spawn sequence of -1 will give give you an object 90% it's original size.  A spawn sequence of ten will create an object twice it's original size.

 

It is also important to note, as FreedTerror mentioned, object scaling ingame works best on objects with normal physics.

"If you want to make an object float and scale to work, set the object to phased or fixed then without grabbing the object set the physics to normal. Depending on the object, it should stay in place and scale should work."

 

Now object scaling is relatively simple, but I believe that it is important to have a standard scaling system; here is what I use in my newest gametypes.

 

 

1.  Add this string under Strings

      <String name="scale">        <String>scale</String>      </String>

2.  Add scale under ObjectFilters

    <ObjectFilters>      <Filter labelIndex="scale" name="scale" />    </ObjectFilters>

3.  Add ObjectNumeric0 to Numeric under ObjectVariables

    <ObjectVariables>      <Numeric>        <Var name="ObjectNumeric0" varRefType="Int16">0</Var>      </Numeric>    </ObjectVariables>

4.  Add the following trigger to Triggers

      <Trigger execMode="OnObjectFilter" name="TriggerScale" objectFilter="scale">        <Elements>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Custom" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>            <Param type="VarReference" varRefKind="Custom" varRefType="SpawnSequence" dataType="Iterator.Object"></Param>            <Param type="OperationType">Set</Param>          </E>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Custom" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>            <Param type="VarReference" varRefKind="Custom" varRefType="Int16">10</Param>            <Param type="OperationType">Multiply</Param>          </E>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Custom" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>            <Param type="VarReference" varRefKind="Custom" varRefType="Int16">100</Param>            <Param type="OperationType">Add</Param>          </E>          <E type="Action" name="ObjectScale">            <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.Object" />            <Param type="CustomReference" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>          </E>          <E type="Condition" name="Comparison" unionGroupID="-2">            <Param type="VarReference" varRefKind="Custom" varRefType="SpawnSequence" dataType="Iterator.Object" />            <Param type="VarReference" varRefKind="Custom" varRefType="Int16">-9</Param>            <Param type="ComparisonType">LessThan</Param>          </E>          <E type="Action" name="ObjectScale">            <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.Object" />            <Param type="CustomReference" varRefType="Int16">1</Param>          </E>        </Elements>      </Trigger>
Edited by 7ime
added starting Elements param

Share this post


Link to post
Share on other sites

Wow, this is a pretty genius system you've got set up. I think you're just lacking a little documentation here - I was able to figure it out by looking at how the triggers worked but not everyone will be able to figure it out for themselves. You might want to add something to the OP like:
"Set the "scale" object filter on the items you want affected. The scale percentage will be determined by 10 times the spawn sequence number plus 100; with the sequence being between -9 and 100, so -9 = 10%, 0 = 100%, 10 = 200%, etc."

 

Btw, here's a cone I have set to 600% scale:
11483044795_3962becd49_o.png

 

Edit: I added the Elements tag to the trigger in the OP because it was missing.

 

Edit 2: The trigger will work on either version of ksoft at the time of writing this, all action and condition names and their inputs used here have not changed between versions 4912 and 5040.

7ime likes this

Share this post


Link to post
Share on other sites

Wow, this is a pretty genius system you've got set up. I think you're just lacking a little documentation here - I was able to figure it out by looking at how the triggers worked but not everyone will be able to figure it out for themselves. You might want to add something to the OP like:

"Set the "scale" object filter on the items you want affected. The scale percentage will be determined by 10 times the spawn sequence number plus 100; with the sequence being between -9 and 100, so -9 = 10%, 0 = 100%, 10 = 200%, etc."

Nice catch, thanks for the feedback.

Share this post


Link to post
Share on other sites

It's worth noting that objects with phased or fixed physics will not scale up or down. Only objects with normal physics will scale up or down. If you want to make an object float and scale to work, set the object to phased or fixed then without grabbing the object set the physics to normal. Depending on the object, it should stay in place and scale should work.

 

If you want to test If the object floats with normal physics. Set up the object using the normal physics trick then shoot at it or chuck a grenade at it or bump into it. 

Edited by FreedTerror
OrangeMohawk, 7ime and Teancum like this

Share this post


Link to post
Share on other sites

Thanks FreedTerror.  I thought I mentioned it but it must have been somewhere else.

 

 

*Edit*  That's where I mentioned it, in my Bonus Slayer Gametypes post.  *Edit*

Edited by 7ime

Share this post


Link to post
Share on other sites

Thanks FreedTerror.  I thought I mentioned it but it must have been somewhere else.

No problem. Might want to add that to the OP

Share this post


Link to post
Share on other sites

I'm not too sure anyone's really interested but in case they are, here is the code that I use now that also changes the scale of whatever object is within the base object's boundary.  You could always turn this into a subtrigger and put it within a local trigger but I'm not too convinced that it runs very well when doing that.

 

Replace the code from step 4 in the OP with this instead if you'd like:

      <Trigger execMode="OnObjectFilter" name="TriggerScale" objectFilter="scale">        <Elements>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="GlobalObject0"></Param>            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="NONE"></Param>            <Param type="OperationType">Set</Param>          </E>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Custom" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>            <Param type="VarReference" varRefKind="Custom" varRefType="SpawnSequence" dataType="Iterator.Object"></Param>            <Param type="OperationType">Set</Param>          </E>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Custom" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>            <Param type="VarReference" varRefKind="Custom" varRefType="Int16">10</Param>            <Param type="OperationType">Multiply</Param>          </E>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Custom" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>            <Param type="VarReference" varRefKind="Custom" varRefType="Int16">100</Param>            <Param type="OperationType">Add</Param>          </E>          <E type="Action" name="VariableOperation">            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="GlobalObject0"></Param>            <Param type="VarReference" varRefKind="Object" varRefType="ExplicitObjectType" dataType="Iterator.Object"></Param>            <Param type="OperationType">Set</Param>          </E>          <E type="Action" name="ActivateTrigger">            <Param type="TriggerReference">              <T type="Trigger" trigType="Subroutine" name="TriggerScale_SubNegative">                <Elements>                  <E type="Condition" name="Comparison" unionGroupID="-2">                    <Param type="VarReference" varRefKind="Custom" varRefType="SpawnSequence" dataType="Iterator.Object" />                    <Param type="VarReference" varRefKind="Custom" varRefType="Int16">-9</Param>                    <Param type="ComparisonType">LessThan</Param>                  </E>                  <E type="Action" name="VariableOperation">                    <Param type="VarReference" varRefKind="Custom" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>                    <Param type="VarReference" varRefKind="Custom" varRefType="Int16">1</Param>                    <Param type="OperationType">Set</Param>                  </E>                </Elements>              </T>            </Param>          </E>          <E type="Action" name="ObjectScale">            <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.Object" />            <Param type="CustomReference" varRefType="Object.NumericVar" dataType="Iterator.Object">ObjectNumeric0</Param>          </E>          <E type="Action" name="ObjectSetBoundaryVisibilityFilter">            <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.Object" />            <Param type="EntityFilter" filterType="Any" />          </E>          <E type="Action" name="ActivateTrigger">            <Param type="TriggerReference">              <T type="Trigger" trigType="Subroutine" execMode="OnEachObject" name="TriggerScale_Sub0">                <Elements>                  <E type="Condition" name="Comparison" unionGroupID="-2">                    <Param type="VarReference" varRefKind="Team" varRefType="Object.OwnerTeam" dataType="GlobalObject0" />                    <Param type="VarReference" varRefKind="Team" varRefType="Object.OwnerTeam" dataType="Iterator.Object" />                    <Param type="ComparisonType">Equal</Param>                  </E>                  <E type="Condition" name="Comparison" unionGroupID="-3">                    <Param type="VarReference" varRefKind="Team" varRefType="Object.OwnerTeam" dataType="GlobalObject0" />                    <Param type="VarReference" varRefKind="Team" varRefType="ExplicitTeamType" dataType="TeamNeutral" />                    <Param type="ComparisonType">Equal</Param>                  </E>                  <E type="Condition" name="ObjectIsInBoundary" unionGroupID="-2">                    <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.Object"></Param>                    <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="GlobalObject0"></Param>                  </E>                  <E type="Action" name="ObjectScale">                    <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.Object" />                    <Param type="CustomReference" varRefType="Object.NumericVar" dataType="GlobalObject0">ObjectNumeric0</Param>                  </E>                </Elements>              </T>            </Param>          </E>        </Elements>      </Trigger> 

You'll also need to add GlobalObject0 to step 3 like so:

    <GlobalVariables>      <Object>        <Var name="GlobalObject0"</Var>      </Object>    </GlobalVariables>    <ObjectVariables>      <Numeric>        <Var name="ObjectNumeric0" varRefType="Int16">0</Var>      </Numeric>    </ObjectVariables> 

For fixed or phased objects, I suggest setting their spawn sequence to 1 and setting it to not spawn at start so that it will actually scale.

 

On a side note, the way this is set up, you could use a global numeric instead of an object numeric if you wanted.

Linglin and OrangeMohawk like this

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