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 → Possible Cog Question
Possible Cog Question
2002-08-07, 2:22 PM #1
I'm not totally sure if this would have to do with the cog, but I downloaded the Advanced Grapple Mod from the JK Mods section. I think it has some nice potential to add a different angle of amusement to some nf gun action, but I found a few things that pretty much stop that from happening.

The biggest problem is, if the hook itself is shot by you or another player, and lets use oasis as an example of the level, no matter where the hook was, you are now grappled to one of the pillars that hold up the catwalk. This pretty much ruins the whole idea.

Then the same thing happens if you grapple to the sky.

I was wondering if anybody would be gracious enough to see if they might be able to pinpoint the problem in that mod and maybe help me out to make these 2 problems disappear. I'd really appriciate it.
2002-08-07, 2:33 PM #2
The problem is simple, the grapple can be destroyed. Modification of the static.jkl can fix this.


When the grapple is destroyed, the cog no longer has a referance point to puch the player to . . . so it uses a null value. In this case, 0 0 0. In this level, that piller is in the center of the level.


In short, this isnt a cog problem.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-07, 7:01 PM #3
Ah, many thanks for that rundown. Might you know what I would need to change to remedy this?
2002-08-07, 7:16 PM #4
Track down the grapple template. Remove any references to health. Or, alternatively, increase them to ungodly values.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-07, 7:26 PM #5
Wouldn't that be in the cog? Might you be able to help me over icq or the zone for a few minutes?
2002-08-07, 9:19 PM #6
As a semi-update, i've been trying to figure out the problem this whole time. Nowhere in the template nor the cog does it say anything about health. I'm wondering if an invul flag needs to be added to the cog, and how to properly do that. I'd appriciate any input I can get on this.
2002-08-08, 11:00 AM #7
Well, GetThingHealth() is used in the cog, but it's completely irrelevant. Besides that, both the cogs and template are seriously flawed - there are many mistakes. Frankly, it bothers me that people can release mods like this.

I cleaned up the item_hook cog and the template:

Code:
# ITEM_HOOK.COG
#
# Inventory cog to control a grappling hook. This cog's bin
# should be flagged 0x10.
#
#==============================================================#
symbols

sound     grapfireSound=grfire.wav         local
sound     grapretractSound=grretract.wav   local

thing     player                           local
thing     graphook                         local

template  grap=+grapplehook                local

int       on                               local

vector    dir                              local

message   startup
message   activated
message   pulse
message   killed
message   damaged
message   removed

end
#==============================================================#
code
#------------------------------------------------------
startup:
	player = GetLocalPlayerThing();
	call stop_hook;

Return;
#------------------------------------------------------
activated:
	if(on)
	{
		PlaySoundThing(grapretractSound, player, 1.0, -1, -1, 0x80);
		Print("Grapple Retracted");
		call stop_hook;
	}
	else
	{
		graphook = FireProjectile(player, grap, grapfireSound, 75,
		'0.0135 0.1624 0.0', '0 0 0', 0, 0, 0, 0);
		CaptureThing(graphook);
		Print("Grapple Deployed");
		on = 1;
		ClearPhysicsFlags(player, 0x1);
		SetPulse(0.1);
	}

Return;
#------------------------------------------------------
pulse:
	if(IsThingMoving(graphook)) Return;
	if(GetThingAttachFlags(player) & 0x1)
	{
		DetachThing(player);
		ApplyForce(player, VectorScale(GetThingUVec(player), 40));
	}
	dir = VectorScale(VectorNorm(VectorSub(GetThingPos(graphook), GetThingPos(player))), 40);
	ApplyForce(player, dir);

Return;
#------------------------------------------------------
killed:
	removed:
	call stop_hook;

Return;
#------------------------------------------------------
stop_hook:
	SetPulse(0);
	if(graphook) DestroyThing(graphook);
	on = 0;
	SetPhysicsFlags(player, 0x1);

Return;
#------------------------------------------------------
damaged:
	if(GetParam(1) == 0x40) ReturnEx(0);
	else ReturnEx(GetParam(0));

Return;
#------------------------------------------------------
end

And the template:
Quote:
<font face="Verdana, Arial" size="2">
_grapbase none orient=(0/0/0) type=weapon collide=1 move=physics thingflags=0x20000000 mass=5 physflags=0x200 maxrotvel=90 typeflags=0

+grapplehook _grapbase model3d=hook.3do size=0.003 movesize=0.003 soundclass=rail.snd surfdrag=3 airdrag=0 mass=1 vel=(0/2.5/0) angvel=(0/0/90) buoyancy=0.25 typeflags=0x80
</font>


The item_hook bin should have the 0x10 Inventory flag. This would make the total flags 0x130. The 0x10 flag calls the damaged message in the bin's cog. Because that damaged message was all that kyle.cog was used for, you can delete it from the patch.

Now, this system is not perfect, but it's much better than it was originally. Good luck. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited August 08, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-08, 11:12 AM #8
Added your changes, but the hook still gets destroyed and latches to 0,0,0.
2002-08-08, 11:33 AM #9
How did you add them? I tested the cog and template and I'm sure they work correctly.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-08, 11:54 AM #10
i extracted them and copied over the whole cog and the two parts of the static you changed, deleted the originals from the gob, replaced them with the changed ones, and removed kyle.cog.
2002-08-08, 3:24 PM #11
Not sure what you did incorrectly, but did you delete the old templates and add the ones I posted? If you still can't get it to work, I can email you the new gob.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-08, 4:00 PM #12
hmm, yeah try emailing me the gob. nicodemus007@earthlink.net
2002-08-09, 5:52 AM #13
Ok, check your inbox. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!