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 → anyone know how to use the cog phrases?
anyone know how to use the cog phrases?
2002-08-08, 1:16 PM #1
I'm working on a cog for a "drivable" speeder bike, but my bigest problem is I can't get it to move.
I've tried to use SetThingVel();, but it only goes in the direction it's pointing at startup. And the speed is determined by the yaw in the direction that you are facing.
I can't get SetThingThrust(); to work does anyone know how to use it?
Would it work to add "type=actor" to the speeder 3do's template, and use the phrase AiSetMoveSpeed();

This is off the subject but does anyone know how to use JkSetTarget(); and JkSetTargetColors();?
2002-08-08, 3:08 PM #2
Yes, somebody knows. [http://forums.massassi.net/html/smile.gif]

Quote:
<font face="Verdana, Arial" size="2">I've tried to use SetThingVel();, but it only goes in the direction it's pointing at startup. And the speed is determined by the yaw in the direction that you are facing.</font>


You're using it incorrectly if that's what happens. Use something like:
Code:
SetThingVel(object, VectorScale(GetThingLVec(object), speed));

This will make the object travel at the given speed in the direction that it's looking.

Quote:
<font face="Verdana, Arial" size="2">I can't get SetThingThrust(); to work does anyone know how to use it?</font>


First, download the DataMaster - the link's in my signature. Find the Velocity section of the Cog verbs. In that section, you'll see a link to SetThingThrust() and its syntax. In the notes of that section, there's a few paragraphs on Thing Thrusts.

Quote:
<font face="Verdana, Arial" size="2">Would it work to add "type=actor" to the speeder 3do's template, and use the phrase AiSetMoveSpeed();</font>


It's not so easy to convert a template to an actor template to use AI commands. For what you're doing, you probably don't want to use a thing of type actor. And Cog commands are usually called either "verbs" or "functions," but not "phrases."

Quote:
<font face="Verdana, Arial" size="2">This is off the subject but does anyone know how to use JkSetTarget(); and JkSetTargetColors();?</font>


Look them up in the Misc Verbs category of the DataMaster's Cog Verbs.

Related to making the bike move is getting it to look in the right direction. For that, you'd use SetThingLook().

Really, making a drivable vehicle is not such an easy project. I wouldn't recommend it for a beginner. But anyway, I hope that answers your questions. [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.
2002-08-08, 4:34 PM #3
On the other hand, I do need to make a driveable vehicle cog . . . something Ive never been able to do satisfactorally.


Any advice?

------------------
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.

[This message has been edited by GBK (edited August 08, 2002).]
And when the moment is right, I'm gonna fly a kite.
2002-08-08, 7:44 PM #4
GBK I suggest you use an attach instead of changing the player model. Even though each has its own advantages and disanvantages. Also if its got wheels I would make them a 3do and create 4 of them.

I would like to help with any other coding but I doubt my cog abilities are remotly close to yours. If you need any help with the physics of it I would hapily help. If you do write it make sure you remember things like inertia.
Team Battle.
2002-08-09, 4:49 AM #5
No wheels, its an AT-AA.

------------------
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-09, 5:56 AM #6
I bet the General's new model.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-09, 6:17 AM #7
I'm not quite sure what an AT-AA is. Haven't seen that new model either. [http://forums.massassi.net/html/frown.gif]

Though I haven't made a really good drivable vehicle, I would say to use the change-model method. Yeah, a lot of people say it's the easy way out and all, but unless you want to have more than one player in the vehicle, I think it's the better way.

And also, I believe that's the way it was done in the Infernal Machine.

------------------
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-09, 6:46 AM #8
All Terrain Anti Air. AT-AA. This topic for the model pics.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-09, 7:53 AM #9
Thanks SaberMaster, That should really give me a boost. The cog is actually coming along pretty well. [http://forums.massassi.net/html/smile.gif]
2002-08-09, 8:15 AM #10
One thing, if you can see the player in the vehicle, attach him to it. IF not, changing the model is simpler.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-09, 10:45 AM #11
Yeah, Ill problably change the model/pup/parsearg the other variables.

I realy dont feel like trying to make any other method work, when changemodel has had such success. I mean, just look at swoop!


IM used changemodel? Anyone have any cogs from IM? Id like to see what new commands they threw in...

------------------
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-09, 12:55 PM #12
You're welcome, force_dude. [http://forums.massassi.net/html/wink.gif]

Quote:
<font face="Verdana, Arial" size="2">IM used changemodel? Anyone have any cogs from IM? Id like to see what new commands they threw in...</font>


In a couple of the levels, Indy drives a jeep around. I looked at the coding for it, and I remember they created a SetExtCamOffset() to use with it. I don't have the game with me right now or I'd look it up. [http://forums.massassi.net/html/frown.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.
2002-08-09, 3:11 PM #13
Ok, GBK contact strike and ask if he can send you his vechile code. Its the best I've seen so far. Pity he lost the best one, hes only got an old one.

strike_1337@hotmail.com
Team Battle.
2002-08-10, 10:49 AM #14
They never remember MY cog... that had brakes, head/braking lights, reverse... teh thing that says beep, and working exhaust tubes with smoke... [http://forums.massassi.net/html/biggrin.gif]

------------------
Uh-uh. I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kind of lost track myself. But being this is a .44 Magnum, the most powerful handgun in the world, and would blow your head clean off, you've got to ask yourself one question: Do I feel lucky? Well do ya, punk?
Last edited by mb; today at 10:55 AM.
2002-08-10, 12:33 PM #15
[http://forums.massassi.net/html/eek.gif] Let me have it!

------------------
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-10, 2:50 PM #16
I remember it... it had mp issues too.
Team Battle.
2002-08-10, 2:53 PM #17
Is it possible for you to post it for us?? I'd like to take a look at it...
Team Battle.
2002-08-11, 12:14 AM #18
I lost it when i formated, but i have a very early version of it on my computer... this one has no reverse, beepbeepthinger or lights yet... wait, i think it has somekind of lights... not working, though [http://forums.massassi.net/html/biggrin.gif]

Code:
# Jedi Knight Cog Script
#

# pad_c.COG
#

# Description

# 

#

# This Cog is Not supported by LucasArts Entertainment Co


# This flag makes the cog act locally, no broadcasting, less lag.

flags=0x240
symbols
thing		pattach
thing		pad
thing		atac
thing		player		local
template	lookt=+ghost
template	smoke=+heavysmoke
vector		look		local
int		lookie		local
vector		lookv		local
vector		plalo		local
int		act=0		local
int		bikek		local
int		akti=0		local
int		origfla		local
sector		curr		local
int		heat=0		local
keyframe	bikesit
keyframe	bikeidle
int		padID
int		enkine		local
sound		whiner
sound		starter
sound		shutdown

message		startup
message		join
message         trigger
end
# ========================================================================================
code
startup:
	player = GetParam(0);
Return;

join:
SyncThingAttachment(player);
SyncThingAttachment(pad);
Return;

trigger:
	
	if( (GetSourceRef() == 120 + padID)) 
	{
	AttachThingToThingEx(pad, pattach, 0x8);
	AttachThingToThingEx(atac, pattach, 0x8);
	}
	else
	if( (GetSourceRef() == 130 + padID)) 
	{
	SetThingPos(player, VectorAdd(GetThingPos(pattach), '0.0 0.0 0.13'));
	AttachThingToThingEx(player, pattach, 0x8);
	bikek = PlayKey(player, bikesit, 1, 0x14);
	ParseArg(player, "maxheadpitch=-15.00");
	ParseArg(player, "minheadpitch=-17.50");
	ParseArg(player, "maxrotthrust=45");
	PlaySoundThing(starter, player, 0.35, 1.0, 5.0,0x80);
	StopSound(enkine, 0.0);
	Sleep(GetSoundLen(enginest));
	enkine = PlaySoundThing(whiner, player, 0.35, 1.0, 5.0, 0x81);
	SetHeadLightIntensity(player, 3);
	SetActorFlags(player,4);
	}
	else
	if( (GetSourceRef() == 140 + padID)) 
	{
	Print("WERKS!!!!");
	DetachThing(GetParam(0));
	StopKey(player, bikek, 0.0);
	StopThing(pattach);
	StopThing(player);
	ParseArg(player, "maxheadpitch=80.00");
	ParseArg(player, "minheadpitch=-80.00");
	ParseArg(player, "maxrotthrust=180");
	SetThingPos(player, VectorAdd(GetThingPos(pattach), '0.15 0.15 0.15'));
	ClearActorFlags(player,4);
	}
	else
	if( (GetSourceRef() == 150 + padID)) 
	{
	curr = GetThingSector(player);
	lookie = FireProjectile(player, lookt, -1, -1, '0.0 0.0 0.0', '0 0 0', 1, 0x20, -1, -1);
	//FireProjectile(atac, bikedama, -1, -1, '0.11 0.11 0.0', '0 0 0', 1, 0x20, -1, -1);
	lookv = GetThingLVec(GetParam(0));
	SetThingLook(pad, lookv);
	SetThingLook(atac, lookv);
	SetThingLook(pattach, GetThingLVec(lookie));
	if(IsInvActivated(player, 42) == 0 && IsThingCrouching(player) == 0)
	{
	ApplyForce(pattach, VectorScale(GetThingLVec(player), 3));
	CreateThing(smoke, pattach);
	akti = 0;
	heat = heat - 1;
	}
	else
	if(IsInvActivated(player, 42) == 1)
	{
		if(akti == 0)
		{
		akti = 1;
		StopThing(Pattach);
		}
		else
		if(akti == 1)
		{
		ApplyForce(pattach, VectorScale(GetThingLVec(player), 0.005));
		}
	}
	//CreateThing(firesmoke, atac);
	DestroyThing(lookie);
	StopSound(enkine, 0.0);
	PlaySoundThing(shutdown, player, 0.35, 1.0, 5.0,0x80);
	}
	

	return;
end


Code:
# Jedi Knight Cog Script
#
# Drivableveh.COG
#
# [Cave_Demon, 02/02/02]
# 
#
# This Cog is Not supported by LucasArts Entertainment Co
symbols

thing		pattach
thing		pad
thing		player		local
template	lookt=+ghost
vector		look		local
int		lookie		local
vector		lookv		local
vector		plalo		local
int		act=0		local
int		padID

message	startup
message	activated
message	pulse
message killed

end

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

code
startup:
	player = GetLocalPlayerThing();
	SendTrigger(-1, 120 + padID, player, 0, 0, 0);
Return;
activated:

if(act == 0)
	{
	SendTrigger(-1, 130 + padID, player, 0, 0, 0);
	SetPulse(0.0125);
	act = 1;
	}
else
if(act == 1)
	{
	SetPulse(0.0);
	SendTrigger(-1, 140 + padID, player, 0, 0, 0);
	act = 0;
	}
Return;

killed:
if(player == GetSenderRef())
	{
	SendTrigger(-1, 140 + padID, player, 0, 0, 0);
	}
Return;

pulse:

	SendTrigger(-1, 150 + padID, player, 0, 0, 0);

Return;


end

first one is client, second is server... i'm not sure wether that was the correct cog, or the one with them both in same, which i don't have [http://forums.massassi.net/html/frown.gif]...



------------------
Uh-uh. I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kind of lost track myself. But being this is a .44 Magnum, the most powerful handgun in the world, and would blow your head clean off, you've got to ask yourself one question: Do I feel lucky? Well do ya, punk?
Last edited by mb; today at 10:55 AM.
2002-08-11, 12:17 AM #19
oh, if i'm not mistaken, the bikes shut down after a while, to avoid overheat... or then they overheat when you use the turbo, which i don't remember how to use [http://forums.massassi.net/html/smile.gif]

------------------
Uh-uh. I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kind of lost track myself. But being this is a .44 Magnum, the most powerful handgun in the world, and would blow your head clean off, you've got to ask yourself one question: Do I feel lucky? Well do ya, punk?
Last edited by mb; today at 10:55 AM.
2002-08-11, 12:19 AM #20
the thing the bike and player are attached to, is a crate that has invisible flags, that way, if you ride over something, it damages the victim... and i couldn't figure another way to get it working [http://forums.massassi.net/html/biggrin.gif]

------------------
Uh-uh. I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kind of lost track myself. But being this is a .44 Magnum, the most powerful handgun in the world, and would blow your head clean off, you've got to ask yourself one question: Do I feel lucky? Well do ya, punk?
Last edited by mb; today at 10:55 AM.
2002-08-11, 9:47 AM #21
Heh, I remember those cogs. [http://forums.massassi.net/html/smile.gif] In fact, I see some of the same mistakes that I corrected last time I worked with them. [http://forums.massassi.net/html/tongue.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.
2002-08-12, 5:32 AM #22
These are exactly the same cogs [http://forums.massassi.net/html/tongue.gif] i uploaded them somewhere, that way i still have them [http://forums.massassi.net/html/smile.gif]

------------------
Uh-uh. I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kind of lost track myself. But being this is a .44 Magnum, the most powerful handgun in the world, and would blow your head clean off, you've got to ask yourself one question: Do I feel lucky? Well do ya, punk?
Last edited by mb; today at 10:55 AM.

↑ Up to the top!