Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → What cogs are run when a saved game is loaded
What cogs are run when a saved game is loaded
2001-05-06, 5:09 AM #1
Hi,

I am trying to change the force powers that you start with when playing the original JK levels that come with the game. I tried adding them by putting stars in the appropriate bins and activating those bins. I did this in kyle.cog under the startup message. This works fine if you start a new game. But if you save a game and later load it, those force powers do not get enabled. I'd like to know either which cogs are run when loading a saved game, or what message is sent. Ultimately, I want to know where I should put my force initialization so it is run both at game startup and saved game startup. Thanks for any help.

Mike
2001-05-06, 11:53 AM #2
Does the player pick these forces or are they awarded to them at the end of a level?
If it's progressive and they get more force powers as they complete levels it might be
easier just to have the cog check what level they are in based on something like

if(GetSurfaceCount() == 1234)
{
// Assign forces
}
- Wisdom is 99% experience, 1% knowledge. -
2001-05-06, 2:56 PM #3
Hi,

The player gets them at the beginning of the game, and they don't change throughout. It works if you don't save the game in progress, but if you do save it the powers are lost when it is loaded. Where would I reassign the powers when the saved game is loaded? Thanks.

Mike
2001-05-07, 2:33 PM #4
i didn't read it all but from what i did read it is impossible, edited cogs don't usually work with saved games

------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-05-07, 4:38 PM #5
Yeah, That's true. Ever try loading a normal JK save with a mod/patch activated? [http://forums.massassi.net/html/biggrin.gif]
Hey, I'm here! But who cares?
2001-05-07, 5:41 PM #6
Hey,

Since it seems I can't really do what I originally intended, I had to sort of come up with a backdoor method. Since I was only concerned with the force powers, I wrote a cog that resets the powers to what I want. Then I just assigned a key to the cog, so that when you load the saved game you just hit the key and the powers are restored. The cog checks if they are already enabled or not. Maybe not the cleanest idea, but it works [http://forums.massassi.net/html/smile.gif]

Mike
2001-05-07, 6:04 PM #7
I've added force powers for SP and had it work just fine - even with saved games. Try putting your force initialization stuff in init_kyle in the kyle.cog and then see.

------------------
Warning! User is not Windows compatible.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-05-08, 1:56 PM #8
Hey,

I tried that, but it didn't seem to work. I'm obviously missing something. I haven't played around with cog stuff very much. If maybe you could put up a simple example, I'd appreciate it.

Mike
2001-05-08, 5:37 PM #9
Code:
   if(!IsMulti()) //Because init_kyle is called in multiplayer and this might upset the multi force powers
   {
	if(!getinv(player, 20))   //If the player doesn't have a force rank...
	{
		Setinv(player, 20, 1); //Sets his rank to 1 (out of 8)
		Setinv(player, 14, 100); //Sets his mana to 100 (out of 400)
	}

	//Gives the player most of the force powers, but not the powerful ones
	SetInv(player, 21, 4);
	SetInv(player, 23, 2);
	SetInv(player, 25, 2);
	SetInv(player, 28, 2);
	SetInv(player, 22, 2);
	SetInv(player, 24, 4);
	SetInv(player, 31, 4);
	SetInv(player, 30, 4);
	SetInvAvailable(player, 21, 1);
	SetInvAvailable(player, 23, 1);
	SetInvAvailable(player, 25, 1);
	SetInvAvailable(player, 28, 1);
	SetInvAvailable(player, 22, 1);
	SetInvAvailable(player, 24, 1);
	SetInvAvailable(player, 31, 1);
	SetInvAvailable(player, 30, 1);
   }


Put this code in the init_kyle message of kyle.cog and it should work fine.

------------------
Warning! User is not Windows compatible.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-05-09, 5:57 PM #10
Thanks for your help, I will give that a try. It looks similar to what I tried before, so I must have left something out. Hopefully this will work [http://forums.massassi.net/html/smile.gif]

Mike

↑ Up to the top!