PDA

View Full Version : Ugg...! ParseArg-ing values of the walkplayer...



Lord Kaje
06-18-2005, 05:09 PM
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_

darthslaw
06-18-2005, 05:42 PM
Millenium Tutorial (http://millennium.meekstreet.com/tutorials/?Enemy)
Now through cog, give the actor the secondary fire or in your case, the fov and chance with ParseArg verb to edit its template dynamically.
.
.
.


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.

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)

Hell Raiser
06-18-2005, 05:50 PM
Instead of startup:, place it under newplayer:, which is called when the player spawns.

Upon further thinking, Slaw's code would do you better.

Lord Kaje
06-18-2005, 07:45 PM
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_

Hell Raiser
06-18-2005, 09:45 PM
Did you try Slaw's pulse suggestion or my newplayer: suggestion?

gbk
06-18-2005, 10:03 PM
Startup doesnt get called in Multiplayer games...

Hell Raiser
06-18-2005, 10:10 PM
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?

Lord Kaje
06-19-2005, 04:23 AM
HR -- I tried D Slaw's "created"/"pulse"...

_K_

gbk
06-19-2005, 02:02 PM
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

Hell Raiser
06-19-2005, 04:50 PM
Originally posted by gbk
Startup doesnt get called in Multiplayer games...

... When you respawn. :p

Lord Kaje
06-19-2005, 05:57 PM
So does anybuddy know how to call the ParseArg into a saved SP game...?

_K_

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

May we see the cog please?




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)

Lord Kaje
06-20-2005, 10:30 PM
OK... hope I'm overlookin' sumthin' simple...

Here goes:





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

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]

darthslaw
06-20-2005, 11:56 PM
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)

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 :)

Lord Kaje
06-21-2005, 02:02 AM
Umm... so what should go under the "created" message?

_K_

Quib Mask
06-21-2005, 06:10 AM
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.

zagibu
06-21-2005, 10:15 AM
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.

Lord Kaje
06-21-2005, 11:22 AM
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_

darthslaw
06-21-2005, 04:53 PM
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...

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.

Lord Kaje
06-21-2005, 07:59 PM
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_

Hideki
06-22-2005, 09:25 PM
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:

Hideki
06-22-2005, 09:30 PM
Oh wait...There is no such cool verb as SetThingTemplate...perhaps it was for MotS...

SG-fan
06-22-2005, 10:50 PM
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.

Lord Kaje
06-23-2005, 03:30 AM
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_