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 → now, i know this is wrong... but i have the basic idea..
now, i know this is wrong... but i have the basic idea..
2001-11-08, 4:26 PM #1
ok, here is a cog jipe helped me with, i screwed it up bad cuz i have no cogging abilities, and jipe is a busy man, so i was wondering if someone could help?

here's all the cog i have:

Code:
# Jedi Knight Cog Script
#
# CHOPPYCHOPCHOP.COG
#


symbols

thing		player				local
thing		ghost
template    gib1=+g1                     local
template    gib2=+g1                     local
template    gib3=+g1                     local
template    gib4=+g2                     local
template    gib5=+g2                     local
template    gib6=+blood3                 local
sector	fansector

int		oldflags


#------------------------------------------------------------

messages

startup:

player = GetLocalPlayerThing();

enter:

if(GetSenderRef() == fansector)

{
oldflags = GetThingFlags(player);
SetThingsFlags(player, GetThingFlags(player) & 0x01);
CreateThing(gib1, SetThingPos(Player));
CreateThing(gib2, SetThingPos(Player));
CreateThing(gib3, SetThingPos(Player));
CreateThing(gib4, SetThingPos(Player));
CreateThing(gib5, SetThingPos(Player));
CreateThing(gib6, SetThingPos(Player));
TeleportThing(player, respawn);
SetThingFlags(player, oldflags);

}

end


------------------
SDÅ_Lªkútí
SDÅ_Lªkútí
2001-11-08, 5:08 PM #2
# Jedi Knight Cog Script
#
# CHOPPYCHOPCHOP.COG
#

symbols
thing player local
thing ghost
template gib1=+g1 local
template gib2=+g1 local
template gib3=+g1 local
template gib4=+g2 local
template gib5=+g2 local
template gib6=+blood3 local
sector fansector
int oldflags

#------------------------------------------------------------
messages
startup:
player = GetLocalPlayerThing();
enter:
if(GetSenderRef() == fansector)
{
oldflags = GetThingFlags(player);
SetThingsFlags(player, 0x01);
CreateThing(gib1, player);
CreateThing(gib2, player);
CreateThing(gib3, player);
CreateThing(gib4, player);
CreateThing(gib5, player);
CreateThing(gib6, player);
TeleportThing(player, respawn); // somewhere in the cog, you need to assign the var
//"respawn" to something
SetThingFlags(player, oldflags);
// or ClearThingFlags(player, 0x01);
}
end

Yeah, I read GBK's message, then realized I might have confused languages, So i tried a few ways that i thought might work. You cannot use arrays how I had them. I need to keep my ish straight. Anyways its right now.

[This message has been edited by Maggot (edited November 08, 2001).]
2001-11-08, 5:33 PM #3
I was not aware one could run arrays like that in cogs. Hmm. Very interesting.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-09, 4:58 AM #4
Code:
# Jedi Knight Cog Script
#
# CHOPPYCHOPCHOP.COG
#
symbols

int		i		local

thing 		player 		local
thing 		respawn

template 	gib0=+g1 	local
template 	gib1=+g1 	local
template 	gib2=+g1 	local
template 	gib3=+g2 	local
template 	gib4=+g2 	local
template 	gib5=+blood3 	local

sector 		fansector

message		startup
message		entered

end

code

startup:
    player = GetLocalPlayerThing();
  return;

entered:
    if (GetSenderRef() == fansector)
    {
       SetThingFlags(player, 0x);
       for (i = 1; i <= 6; i = i + 1)
       {
         CreateThing(gib0, player);
       }
       TeleportThing(player, respawn);
       ClearThingFlags(player, 0x);
    }
  return;

end


Things to do *before* you save as *.cog:

Fill in the flags in the SetThingFlag() and the ClearThingFlag() lines above so they read something like 0x10 instead of just 0x. Code Alliance is down, and I don't have a copy of JKSpecs on this computer, so I can't reference the invis flag. Coincidentally, it *might* be 0x10..

Things to define in Jed:

fansector: sector where fan is (heh)
respawn: just a ghost thing where you want the player to respawn; I could make it random (ex: 1 of 4 locations), but laziness has won over..

Sorry for not getting this to you earlier, there's no excuses.

-Jipe

[This message has been edited by Jipe (edited November 09, 2001).]
2001-11-09, 5:06 AM #5
thanks!

------------------
SDÅ_Lªkútí
SDÅ_Lªkútí
2001-11-09, 7:08 AM #6
Ok, it works but still not what i needed...

ok, first of all the player doesn't get killed when he enters the sector, secondly the respawning is a little bit off, what i had in mind was that the player goes to a camera view (so he can see his gibs getting sucked through the fan) and then when it says "Press Fire to Respawn" or whatever, when he fires he respawns to the Viewing area (btw this is a JKA level, just to clarify) and his flags are returend to 0x20000401.


As of now it works good as far as you hit the fan and you splode to chunks and you are invisible, but the problems are that the player needs to be killed, Your flags are never returned to the original flags, the camera view is not in there at all, also, it looks like the templates being created are random cuz sometimes it comes out with all of them sometimes it only comes out as 1.. which doesn't look so impressive. I'd also like it to paly a soudn when he hits the fan...

k, i think that's it..


------------------
SDÅ_Lªkútí

[This message has been edited by SDA_Lakuti (edited November 09, 2001).]
SDÅ_Lªkútí
2001-11-09, 8:55 AM #7
This should do the trick...

 

# 11/2001 GBK
Symbols
Message Entered
Thing Player Local
Sector Fan_sector
Template Gib0
Template Gib1
Template Gib2
Template Gib3
Template Gib4
Template Gib5
Sound Kill_sound
Int I=0 Local
End
Code
Entered:
Player = Getlocalplayerthing();
If(Getsenderref() == Fan_sector) {
Setthingflags(Player, 0x10);
Setcurrentcamera(1);
Playsoundpos(Kill_sound, Getthingpos(Player), 1.0, 0.1, 5.0, 0x0);
For(I=0;I<=5;I=I+1) { Creatething(Gib0, Player); }
Damagething(Player, 100, 0x0, Player); }
Stop;
End

 


It works, I tested it. [http://forums.massassi.net/html/biggrin.gif]


Resetting the thingflags arent that important, they will reset automaically when the player respawns.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-09, 9:29 AM #8
ok, the thingflags don't reset, and is it possible ot put a camera view in there? one that starts at death and and ends at respawn?

thanks for what you've done so far...

------------------
SDÅ_Lªkútí
SDÅ_Lªkútí
2001-11-09, 11:46 AM #9
Do you mean an external 'ghost' camera? I dont think thats possible without modifing Kyle.cog.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-09, 12:47 PM #10
hmmm, that's too bad.. [http://forums.massassi.net/html/frown.gif]

------------------
SDÅ_Lªkútí
SDÅ_Lªkútí
2001-11-10, 1:05 AM #11
Not sure about this, but:

Can't you create a new cog and capture the player in the startup message? Then when the player dies from the fan and killed: is called, the camera can be set to a ghost looking at the fan. In the respawn message, the camera would be set back to the player.

[http://forums.massassi.net/html/confused.gif]

------------------
Thank you for sending me a copy of your mod - I'll waste no time playing it.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-11-10, 5:42 AM #12
The problem is, when the play is killed the camera automatically switches to the player.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-10, 9:06 AM #13
I know, but you can use sleep(0.001); or set a timer(which would be safer). After that, the camera would have been set to the player. Then we can reset the camera to the ghost.

Is there a problem with that?

------------------
Thank you for sending me a copy of your mod - I'll waste no time playing it.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-11-10, 12:05 PM #14
There is a big problem with that. It doesnt work.


Go ahead, try it.


I tried for 2 hours straight last night, couldnt get it to work. As soon as the player dies, the camera switches back. And after the player is dead, you cant change the camera. At least I wasnt able to.

And yes, I tried that method. I also tried timers, didnt work either.



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-11, 2:45 PM #15
he's right, the camera doesn't work, it did on the 1st person view in sngleplayer, but that's totally worthless sicne it's a multipalyer level, but what can be done is have everyone elses camera switched (which is waht ended up happening) but i don't want that either [http://forums.massassi.net/html/smile.gif] the cog works fine now, but it has some probs with JKA... [http://forums.massassi.net/html/frown.gif] .. oh well.. thanks for worknig on it guys.

------------------
SDÅ_Lªkútí
SDÅ_Lªkútí

↑ Up to the top!