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 → can I do this?
can I do this?
2001-12-10, 5:53 PM #1
ok so this is a cog generated by the Goal! plugin.. It does what I want it to do, but I'd like it to do more. I'd like the cog to set another "walkplayer" as startpoint if the player dies. Kinda like a checkpoint. Thing0 is the walkplayer and the start of the level.. and when the player get to some checkpoint, it runs the goal script AND, i would like if it could set ThingX as the new walkplayer... anyways... how can I do that?

# Jedi Knight Goal Cog Script - Generated by Goal!, Jed Plugin by dr0id <http://hem2.passagen.se/thesj/dr0idstuff/>
#
# PREVIEWCOG_GOALS.COG
#
# Goals:
# 0 - Checkpoint One
#
# []
#
# This script is NOT supported by LucasArts Entertainment Company
# ==================================================================

symbols
int player local

message startup
message entered

sector sectorGoal0

sound soundGoal0=accomplish1.wav local

int done0=0 local
end

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

code
startup:
player = GetLocalPlayerThing();
SetInv(player, 99, 1000);
SetGoalFlags(player, 0, 1);
Return;

entered:
// Goal: 0
if((!done0) && (GetSenderRef() == sectorGoal0))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal0, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 0, 2);
SetGoalFlags(player, 0, 1);
done0 = 1;
Sleep(5);
jkEndLevel(1);
Return;
}

Return;

end


------------------
_ _______ _
BladeSinger
Sith Domination (http://www.massassi.net/levels/files/1496.shtml)
BladeSinger

-Are you sure this is the Sci-Fi Convention? It's full of nerds!
2001-12-10, 10:36 PM #2
Code:
# Jedi Knight Goal Cog Script - Generated by Goal!, Jed Plugin by dr0id <http://hem2.passagen.se/thesj/dr0idstuff/>
#
# PREVIEWCOG_GOALS.COG
#
# Goals:
# 0 - Checkpoint One
#
# []
#
# This script is NOT supported by LucasArts Entertainment Company
# ==================================================================

symbols
int player local

message startup
message entered

sector sectorGoal0

thing  OriginalWalkplayer=-1
thing  CheckpointWalkplayer=-1

template newwalkplayer=walkplayer local

sound soundGoal0=accomplish1.wav local

int done0=0 local
end

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

code
startup:
player = GetLocalPlayerThing();
SetInv(player, 99, 1000);
SetGoalFlags(player, 0, 1);
Return;

entered:
// Goal: 0
if((!done0) && (GetSenderRef() == sectorGoal0))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal0, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 0, 2);
SetGoalFlags(player, 0, 1);
CreateThing(newwalkplayer, CheckpointWalkplayer);
DestroyThing(OriginalWalkplayer);
done0 = 1;
Sleep(5);
//jkEndLevel(1); I assume you don't want to end the level
Return;
}

Return;

end


This will create a new walkplayer at a GHOST position that you specify, and destroy the old walkplayer. Be sure to link the old walkplayer and the ghost for the new walkplayer to the cog. -duh! lol I haven't tested this, though.

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2001-12-11, 6:12 AM #3
Well.. I must have some problems in the code cause it crashed JK when you enter the sector. I have barel;y enough time to see the game create the other walkplayer then boom it crashes. My guess is when you destroy the OriginalWalkplayer you also destroy the player itself. [http://forums.massassi.net/html/smile.gif]


Also, can you make the cog with more "checkpoints"... Like..

Sound
Sector1
Walkwplayer1
Sector2
Walkplayer2
Sector3
Walkplayer3
etc etc up to Walkplayer 5 or so.

------------------
_ _______ _
BladeSinger
Sith Domination (http://www.massassi.net/levels/files/1496.shtml)
BladeSinger

-Are you sure this is the Sci-Fi Convention? It's full of nerds!

↑ Up to the top!