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 → Ugg...! ParseArg-ing values of the walkplayer...
Ugg...! ParseArg-ing values of the walkplayer...
2005-06-18, 2:09 PM #1
I ParseArg the fov & chance of the walkplayer template in the "startup" message of the kyle.COG... works fine when starting a SinglePlayer game. But when saving an SP game (or dying & then re-spawning), the values are no longer re-set by the kyle.COG's "startup" message...!!! GRRRrrr...!

Is there some way to overcome this?

Please help...!

_K_
2005-06-18, 2:42 PM #2
Quote:
Millenium Tutorial
Now through cog, give the actor the secondary fire [edit]or in your case, the fov and chance[/edit] with ParseArg verb to edit its template dynamically.
.
.
.
Code:
   created:
   SetThingPulse(GetSenderRef(), 1);   //This will keep giving the actor the secondary fire mode.

   return;
# ........................................................................................
   pulse:

   ParseArg(GetSenderRef(), "weapon2=+repeaterball");   //This will change the actor's template through cog.

   return;

.
.
.
1. The reason to pulse is that the effect will be cancelled once the player dies and reloads.
[/b]

I'm guessing JK doesn't save info set by parsearg... it does the same with Joint Amputation info (reload your game and dead guys will have their guns in hand)
May the mass times acceleration be with you.
2005-06-18, 2:50 PM #3
Instead of startup:, place it under newplayer:, which is called when the player spawns.

Upon further thinking, Slaw's code would do you better.
-Hell Raiser
2005-06-18, 4:45 PM #4
That works _perfectly_ for resetting the ParseArg when a player dies in SP.

But it doesn't reset the ParseArg for saved games :<

Is there any way to make it work for saved games?

THANX...!!!

_K_
2005-06-18, 6:45 PM #5
Did you try Slaw's pulse suggestion or my newplayer: suggestion?
-Hell Raiser
2005-06-18, 7:03 PM #6
Startup doesnt get called in Multiplayer games...
And when the moment is right, I'm gonna fly a kite.
2005-06-18, 7:10 PM #7
Quote:
Originally posted by gbk
Startup doesnt get called in Multiplayer games...


[http://www.hellraiser64.com/tdir/forums/images/smiles/o_o4.gif]

You're on something, right?
-Hell Raiser
2005-06-19, 1:23 AM #8
HR -- I tried D Slaw's "created"/"pulse"...

_K_
2005-06-19, 11:02 AM #9
Quote:
Originally posted by Hell Raiser
[http://www.hellraiser64.com/tdir/forums/images/smiles/o_o4.gif]

You're on something, right?


Umm, no? Startup doesnt get called in MP. 'NewPlayer' does. :p
And when the moment is right, I'm gonna fly a kite.
2005-06-19, 1:50 PM #10
Quote:
Originally posted by gbk
Startup doesnt get called in Multiplayer games...


... When you respawn. :p
-Hell Raiser
2005-06-19, 2:57 PM #11
So does anybuddy know how to call the ParseArg into a saved SP game...?

_K_
2005-06-20, 8:30 AM #12
Hmm... the startup/pulse thing was designed to work even when loading savegames... :confused:

May we see the cog please?



Quote:
Umm, no? Startup doesnt get called in MP. 'NewPlayer' does. :p

Startup is called when the level loads, SP or MP.
Newplayer is called each time you respawn (I'm not sure if it's called at the first time you spawn in a MP game -- never experimented)
May the mass times acceleration be with you.
2005-06-20, 7:30 PM #13
OK... hope I'm overlookin' sumthin' simple...

Here goes:

Code:

# ========================================================================================

code
######################################################
   created:
   SetThingPulse(GetSenderRef(), 1);   //change saber defense ability

	// Give Jump to un-initiated
	SetInvAvailable(player, 21, 1);

   return;
# ........................................................................................
######################################################
pulse:

   ParseArg(GetSenderRef(), "fov=-0.1");   //increase saber blocking radius

ParseArg(GetSenderRef(), "error=-1.0");   //increase saber blocking radius

ParseArg(GetSenderRef(), "maxthrust=0.6");//chang actor's speed
##################################
   return;

startup:

   saberCog = GetInvCog(player, 10);
   sithsaberCog = GetInvCog(player, 5);
   extsaberCog = GetInvCog(player, 9);

   if(!IsMulti()) call init_kyle;

   // Bubbles
   if(IsMulti())
      SetTimerEx(4 + 5 * rand(), 2, 0, 0);
   else
      SetTimerEx(2 + 5 * rand(), 2, 0, 0);

   Return;

# ........................................................................................



[ Code tags, please ]
2005-06-20, 8:56 PM #14
I think the problem is that you put the SetThingPulse() under "created" -- I'm pretty sure the player doesn't send that message (but I have no real basis for that belief ;))

Instead, put "SetPulse(1);" in the startup message (instead of SetThingPulse() ), and in the pulse message, replace your code with this: (just a bit of rewriting)
Code:
   player = GetLocalPlayerThing();
   ParseArg(player, "fov=-0.1"); //increase saber blocking radius
   ParseArg(player, "error=-1.0"); //increase saber blocking radius
   ParseArg(player, "maxthrust=0.6");//chang actor's speed


After doing that it ought to work fine :)
May the mass times acceleration be with you.
2005-06-20, 11:02 PM #15
Umm... so what should go under the "created" message?

_K_
2005-06-21, 3:10 AM #16
I've never even heard of/seen a kyle.cog with a created: section before. I'd say just remove it altogether.

Also, even if created: is getting called, your "//Give Jump to un-initiated" references what is likely an undeclared variable at that point: player.

QM

P.S. - ParseArg(player, "fov=-0.1 error=-1.0 maxthrust=0.6"); will do the work of all 3 ParseArg()'s you intend to pass.
2005-06-21, 7:15 AM #17
Quote:
Originally posted by Darth Slaw
I think the problem is that you put the SetThingPulse() under "created" -- I'm pretty sure the player doesn't send that message (but I have no real basis for that belief ;))

The basis for your belief could be that players do not exist as unique things. They "possess" a walkplayer instead. This walkplayer is created at level load, before even the host joins the game. So no created message for playurz.
This is what I believe.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-06-21, 8:22 AM #18
OK... so I give the kyle.COG this:

code

pulse:

player = GetLocalPlayerThing();

ParseArg(player, "fov=-0.1 error=-1.0 maxthrust=0.6");

// Give Jump to un-initiated
SetInvAvailable(player, 21, 1);

return;

# ........................................................................................

startup:

SetPulse(1);
______________________________________

When loading an SP saved game, the player receives the

"SetInvAvailable(player,21,1)"

(Force Jump @ Lvl 0),

but _AGAIN_ the ParseArg values are not called into the SP game...

WTF is going on?

_K_
2005-06-21, 1:53 PM #19
Put this in your pulse message somewhere:
Print("Pulse...");

If it's not printing after you load your game and stuff, put "Sleep(0.1);" before your SetPulse() line. Your startup message should look like this then, I think...
Code:
startup:

   saberCog = GetInvCog(player, 10);
   sithsaberCog = GetInvCog(player, 5);
   extsaberCog = GetInvCog(player, 9);

   if(!IsMulti()) call init_kyle;

   // Bubbles
   if(IsMulti())
      SetTimerEx(4 + 5 * rand(), 2, 0, 0);
   else
      SetTimerEx(2 + 5 * rand(), 2, 0, 0);

   Sleep(0.1);
   SetPulse(1);

   Return;

If that doesn't work, I couldn't tell you why. Though I'm surprised you're getting force jump from savegames but not the parsearg effects... this is why I want you to put the print() line in the pulse message and test to see if it prints, before changing the startup message.
May the mass times acceleration be with you.
2005-06-21, 4:59 PM #20
Quote:
I'm surprised you're getting force jump from savegames but not the parsearg effects...


Yeh -- that's kinda freakin' me out...

Save games _do NOT_ print the "Pulse..." message.

How could JK still allow the player to possess bin 21/F_Jump...?

Think I'll give up on this one for awhile...

Thanx for everything, gang.

_K_
2005-06-22, 6:25 PM #21
It's weired that pulse don't keep working when the game loads from a saved game.

There are several things you can try.
For one is to use timer instead. Timer is just a bit more flexible way of doing pulse. But if you use this, don't get other timers mixed up.

I guess created works on players, and it's easy to verify, give him full ammo or something on created message, see if it makes any effect.

I don't remember what maxthrust does, but if it's the walking speed, you should use SetActorExtraSpeed, which is not even ParseArg, so it should be better.

Startup in multiplayer is quite uesless using on players, since only host is there when the level loads up, not a single client person.

And for last, which I have less confidence is to make a new template for your new player, and use SetThingTemplate... If it even remotely works that way... I don't think you want to pulse this, since it's not ParseArg.

I'm still answering cog questions these days, being my last edit activity years ago :rolleyes:
2005-06-22, 6:30 PM #22
Oh wait...There is no such cool verb as SetThingTemplate...perhaps it was for MotS...
2005-06-22, 7:50 PM #23
Hey, long time to see Hideki!

As far as I know, there is no easy way to change templates (ex setthingtemplate) for JK or MOTS. I did a brief research on that when I was making my ship cog, found nothing.
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2005-06-23, 12:30 AM #24
WHOAH...! Hideki...! LTnoC (Long Time no See)

I figured it'd be better to ParseArg the "fov" & "error" directly in the weap_saber.cog -- looks like that'll do it...

but "setActorSpeed" is probably the command that I needed : THANX...! I'll give that a shot...

Hideki -- I've been messin' around w/one (or two, as the case may be) of yer COGz from back in the day & I've run into some major trouble. Mind if I post my problems regarding said COGz and let ya take a crack at it?

_K_

↑ Up to the top!