Jump to content

What am I doing wrong? (Everything) SetMaterial, Finding Actors and other woes.


Synthorange

Recommended Posts

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Sorry I wasn't able to reply in realtime - just had the longest sleep. Glad it's coming along well. I am *loving* the little avengers. Can you use them elsewhere? I'm just thinking of one buzzing around shen or something, instead of the gremlin ; )

 

What bugs are you left with now?

 

And as for the UPK import, no, I've never had that. I *always* have to delete and re-add for it to pick up changes.

Link to comment
Share on other sites

Okay WHAT THE HELL. I created an x2itemtemplate 'SkyrangerSkinInfo' to store and pass around info about what skins are currently in use and a few other details. Two major problems.

 

1. It does not persist between game sessions. Quit your game and you lose that data.

2. It looks like the data is universal for all games in the same session! If you save a game with Skin A on the ranger and load a game that was saved with Skin B, the game loads up with Skin A! What the hell!

 

Is the item template not a good way to store info? How else should I be doing it?

Link to comment
Share on other sites

Yeah, not an ideal way to be doing it. It's for items, obviously. Like corpses, or grenade, or some cheese. The game loads up the templates at game-start and keeps them around. And, yes, kills them when you quit.

 

I think (but I could be entirely wrong) that you need to write a state to xcomhistory to save stuff, and then load it back out when you load a game. I'd poke around in, for example, the settings screen, to see how they do that. In fact, you might be able to just jack it directly into the system settings. I haven't really dug around, but I feel like I recall someone talking about their mod having options on the settings screen.

 

Edit: maybe look at the difficulty setting, since that's definitely per game.

Edited by zingfharn
Link to comment
Share on other sites

Crud. this isnt working

function CheckforRangerInfoObject(){
local X2_SkyrangerCustomSettings RangerHolder,newRangerHolder;
local XComGameState NewGameState;
RangerHolder=X2_SkyrangerCustomSettings(`XCOMHQ.FindComponentObject(class'X2_SkyrangerCustomSettings'));
if (RangerHolder==none){
newRangerHolder = X2_SkyrangerCustomSettings(NewGameState.CreateStateObject(class'X2_SkyrangerCustomSettings'));
newRangerHolder.InitComponent();
`XCOMHQ.AddComponentObject(newRangerHolder);
`log("Creating Holder" @ newRangerHolder);
}
}

Keeps returning 'Creating Holder none'

class X2_SkyrangerCustomSettings extends XComGameState_HeadquartersXCom;

var int CurrentSkin, TotalSkins, CurrentSong;

function X2_SkyrangerCustomSettings InitComponent() {
	CurrentSkin=0; //current skin
	TotalSkins=20; //total skins
	CurrentSong=0; //current song
	return self;
}

This is the settings holder by the way. It's currently a xcomhq state to try troubleshoot stuff, but was baseobject before with the same results

Edited by Synthorange
Link to comment
Share on other sites

Uuuugh

 

[0102.80] ScriptLog: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[0102.80] ScriptLog: SKINNER INIT CALLED!
[0102.80] ScriptLog: Creating Holder X2_SkyrangerCustomSettings_0
[0102.80] ScriptLog: Got item! None
So creating it is fine. Either assigning it or finding it is a problem.
function CheckforRangerInfoObject(){
	local X2_SkyrangerCustomSettings RangerHolder,newRangerHolder;
	//local XComGameState NewGameState;
	RangerHolder=X2_SkyrangerCustomSettings(`XCOMHQ.FindComponentObject(class'X2_SkyrangerCustomSettings'));
	if (RangerHolder==none){
	//newRangerHolder = X2_SkyrangerCustomSettings(NewGameState.CreateStateObject(class'X2_SkyrangerCustomSettings'));
	newRangerHolder=new class'X2_SkyrangerCustomSettings';
	newRangerHolder.InitComponent();
	`XCOMHQ.AddComponentObject(newRangerHolder);
	`log("Creating Holder" @ newRangerHolder);
	}
}

Is what it looks like now. Returns Creating Holder properly.

function X2_SkyrangerCustomSettings GetHolder(){
	local X2_SkyrangerCustomSettings Holder;
	Holder =X2_SkyrangerCustomSettings(`XCOMHQ.FindComponentObject(class'X2_SkyrangerCustomSettings'));
	`log("Got item!"@Holder);
	return Holder;
}

This though returns none.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...