Jump to content

Kismet Variables


AuroraDelta

Recommended Posts

One of the things I'm stuck on in my mod is the Kismet. I feel like i have most of the pieces assembled but I cant get them to fit properly, so I'm going to put down what I have and hope someone out there can figure out how these go together.

 

So some of the Kismet Sequencing calls ask for teams (like get unit team and OnTurnBegin). In singleplayer this is limited to Alien, XCOM and Civilian. However there is a single call to set up multiplayer games which adds ETeam_One and ETeam_Two, which are the multiplayer teams. In order to change some sequences in the game to react correctly in multiplayer, I need to find a way to add those two teams to the standard singleplayer calls. However this is were I'm having the issue in that I cant figure out how to edit them.

 

Here's what I have so far:

(Kismet Image)

 

 

http://i65.tinypic.com/2ppf14l.jpg

 

This is one of the sequences I need to change, get unit team. As you can see, the options for Team One and Team Two are not present (probably because it was never deemed necessary and was never actually intended in the game). They are not hidden unfortunately and are actually completely missing from the call, and have to be added somehow.

 

 

 

 

The kismet section above seems to either draw from or be an extension of this script, SeqAct_GetUnitTeam.uc

 

 

 

class SeqAct_GetUnitTeam extends SequenceAction;

var XComGameState_Unit Unit;

var() bool GetOriginalTeamIfMindControlled;

event Activated()
{
local XComGameState_Player PlayerState;
local ETeam TeamFlag;

OutputLinks[0].bHasImpulse = false;
OutputLinks[1].bHasImpulse = false;
OutputLinks[2].bHasImpulse = false;

if (Unit != none)
{
PlayerState = XComGameState_Player(`XCOMHISTORY.GetGameStateForObjectID(Unit.GetAssociatedPlayerID()));
TeamFlag = PlayerState.TeamFlag;
if( GetOriginalTeamIfMindControlled && Unit.IsMindControlled() )
{
TeamFlag = Unit.GetPreviousTeam();
}
switch( TeamFlag )
{
case eTeam_XCom:
OutputLinks[0].bHasImpulse = true;
break;
case eTeam_Alien:
OutputLinks[1].bHasImpulse = true;
break;
case eTeam_Neutral:
OutputLinks[2].bHasImpulse = true;
break;
}
}
}

defaultproperties
{
ObjCategory="Unit"
ObjName="Get Unit Team"

bConvertedForReplaySystem=true
bCanBeUsedForGameplaySequence=true

bAutoActivateOutputLinks=false
OutputLinks(0)=(LinkDesc="XCom")
OutputLinks(1)=(LinkDesc="Alien")
OutputLinks(2)=(LinkDesc="Civilian")

VariableLinks(0)=(ExpectedType=class'SeqVar_GameUnit',LinkDesc="Unit",PropertyName=Unit)
}

 

 

 

This part of the code here is what corresponds to the above kismet sequence. Logically it would seem that the solution would just be to add the teams to the correct locations, as such:

 

 

 

class SeqAct_GetUnitTeam extends SequenceAction;

var XComGameState_Unit Unit;

var() bool GetOriginalTeamIfMindControlled;

event Activated()
{
local XComGameState_Player PlayerState;
local ETeam TeamFlag;

OutputLinks[0].bHasImpulse = false;
OutputLinks[1].bHasImpulse = false;
OutputLinks[2].bHasImpulse = false;
OutputLinks[3].bHasImpulse = false;
OutputLinks[4].bHasImpulse = false;

if (Unit != none)
{
PlayerState = XComGameState_Player(`XCOMHISTORY.GetGameStateForObjectID(Unit.GetAssociatedPlayerID()));
TeamFlag = PlayerState.TeamFlag;
if( GetOriginalTeamIfMindControlled && Unit.IsMindControlled() )
{
TeamFlag = Unit.GetPreviousTeam();
}
switch( TeamFlag )
{
case eTeam_XCom:
OutputLinks[0].bHasImpulse = true;
break;
case eTeam_Alien:
OutputLinks[1].bHasImpulse = true;
break;
case eTeam_Neutral:
OutputLinks[2].bHasImpulse = true;
break;
case eTeam_One:
OutputLinks[3].bHasImpulse = true;
break;
case eTeam_Two:
OutputLinks[4].bHasImpulse = true;
break;
}
}
}

defaultproperties
{
ObjCategory="Unit"
ObjName="Get Unit Team"

bConvertedForReplaySystem=true
bCanBeUsedForGameplaySequence=true

bAutoActivateOutputLinks=false
OutputLinks(0)=(LinkDesc="XCom")
OutputLinks(1)=(LinkDesc="Alien")
OutputLinks(2)=(LinkDesc="Civilian")
OutputLinks(3)=(LinkDesc="Team One")
OutputLinks(4)=(LinkDesc="Team Two")

VariableLinks(0)=(ExpectedType=class'SeqVar_GameUnit',LinkDesc="Unit",PropertyName=Unit)
} break;

 

 

 

However, the problem here is that this is not called into the editor. Even loading those files into the mod folder itself will still result in predictably, the editor loading its own version which is probably inside its own build.

 

Now I may just be stupid and this may just be sitting right in front of me and I just cant see it, but if anyone can figure out how to add these extra variables into the sequencing of maps, that would be lovely and it would really make my day.

Link to comment
Share on other sites

You can't override them, but you can make your own. Instead of modifying the existing one you'll need to create a new class that derives from SequenceAction (for an action, at least). Modifying the existing one in xcomgame would basically make your mod a highlander mod, which you may or may not want.

 

So you can easily create a custom version (E.g. MyExtendedGetUnitTeam) that adds the additional cases to the switch in Activated(). Rebuild your mod, then launch the editor and you should be able to create a new node of your new kind by right-clicking and selecting it in the menu. I've done this for both EW and Xcom2.

 

Similarly you can create a new event by making a new class, but I have not done this myself yet so I'm not sure of the details. It looks like you can just extend SeqEvent_X2GameState and then trigger the call to kismet via "Battle.TriggerGlobalEventClass(class'MyEventClass', Battle)" but there may be some details that need to be worked out there.

 

In order to actually use the new nodes you need to make custom kismet sequences, but presumably you're already doing that. If you're defining a new mission type it's probably easiest to make a copy of the mission map (Obj_whatever.umap) that is closest to what you want and then make your changes there. Then you can set your new map to be used for the missions in xcommissions.ini in the "MapNames" array.

Link to comment
Share on other sites

Oh, perfect! This is exactly what I needed and its making everything work perfectly!

 

Or, at least it is giving me the option to make everything work perfectly. In reality merging two completely different game modes with completely different rules is really racking my brain but as far as it now being possible, I'm extremely happy. Now I just have to figure this nonsense out with where everything has to go.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...