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 → Parsec has gone mad!
Parsec has gone mad!
2004-06-06, 5:49 AM #1
Hi!
I'd like to say that Parsec has gone mad. I have a COG, I check it, and it says "Type mismatch. int value expected, but vector found in the if statement on line 249."
I go to line 249, and what do I find?
"{"
Right under "else if(GetSenderID()==14)"

Is there a newer version than 1.7.0 that I can get, or you can make?

/Edward
Edward's Cognative Hazards
2004-06-06, 6:58 AM #2
Mind to post some more lines?

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-06-06, 8:11 AM #3
Code:
timer:
	if(GetSenderID()==15)
	{
		if(onegrenade==1)
		{
		If(GetInv(player,4)>0)
		{ 
			SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
			dummy = FireProjectile(player, projgren, grenadeF, 8, '0.0135 0.1624 0.0', '0 0 0', 5, 0x21, autoAimFOV, autoAimFOV*2);
			ChangeInv(player, 4, -1.0);
			printint(GetInv(player,4));
			print("grenades left");
		}
		else
		{
			PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
			print("EMPTY!");
		}
		onegrenade=0;
		}
	}
	else if(GetSenderID()==2)
	{
   		StopKey(player, holsterTrack, 0.0);
	}
	else if(GetSenderID()==14)
	{
		boredtrack=jkPlayPOVKey(player,povboredAnim0[rand()*2],1,0x38);
		KillTimerEx(14);
		SetTimerEx(10-(rand()*8),14,0,0);
	}
return;

One timer message. Italics show Error Line. Bold shows line before Error.

[This message has been edited by Edward (edited June 06, 2004).]
Edward's Cognative Hazards
2004-06-06, 8:58 AM #4
Post the whole cog.... this is really a problem for SM, though, as its his program. [http://forums.massassi.net/html/tongue.gif]

------------------
Dear lady, can you hear the wind blow, and did you know
Your stairway lies on the whispering wind.
:wq
And when the moment is right, I'm gonna fly a kite.
2004-06-06, 9:39 AM #5
Code:
# Jedi Knight Cog Script
#
# WEAP_BRYAR.COG
#
# WEAPON 2 Script - Bryar Pistol
#
# The trusty weapon of Kyle Katarn. This is actually an older modified rifle
# that has been cut down to more of a pistol size. It is very accurate but
# somewhat of a low power weapon. This weapon has only one type of fire.
#
# - Affected by MagSealed sectors/surfaces.
#
# [YB & CYW]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


symbols

model       povModel=PulseV.3DO                 local
model       weaponMesh=PulseInHand.3DO          local

keyframe    mountAnim=PulseUp.key               local
keyframe    dismountAnim=PulseDown.key          local
keyframe    povfireAnim=PulseShoot.key          local
keyframe    holsterAnim=kyhlstr.key             local
keyframe	povGren=PulseGrenade.key	local
keyframe	povBob=PulseVBob.key		local

keyframe	povboredAnim0=PulseV_bored1.key	local
keyframe	povboredAnim1=PulseV_bored2.key	local
keyframe	povboredAnim2=PulseV_bored1.key	local

sound       outSound=pulse_rifle_empty.wav      local
sound       mountSound=invrotate.wav	        local
sound       dismountSound=PutWeaponAway01.wav   local
sound       fireSound=pulse.wav		        local
sound		grenadeR=Ed_PulseGrenade_reload.wav	local
sound		grenadeF=Ed_PulseGrenade_Launch.wav	local

template    projectile=+bryarbolt               local
template	projgren=+grenade3		local

thing       player                              local

flex        fireWait=0.05                       local
flex        holsterWait                         local
flex		powerBoost			local
flex        autoAimFOV=30                       local
flex        autoAimMaxDist=5                    local

int         weaponIndex                         local
int         trackID=-1                          local
int         dummy=0                             local
int         mode                                local
int         holsterTrack                        local
int		onegrenade=0			local
int		busy=0				local

int		bob=-1				local

int		boredtrack=-1			local
flex		oldammo				local

message     activated
message     deactivated
message     selected
message     deselected
message     autoselect
message     fire
message     timer
message		pulse

end

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

code

fire:
   player = GetSourceRef();

   // Check that the player is still alive.
   if(GetThingHealth(player) <= 0)
   {
      Return;
   }
	KillTimerEx(14);
	SetTimerEx(10,14,0,0);
	if(boredtrack!=-1) { jkStopPOVKey(player, boredtrack, 0.1); boredtrack=-1; }
   // Check Ammo - If we are out, autoselect best weapon.
if(mode!=1) {
   if(GetInv(player, 11) < 1.0)
   {
      PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
      Return;
   }

   SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
   dummy = FireProjectile(player, projectile, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1.0, 0x20, autoAimFOV, autoAimFOV*2);
   ChangeInv(player, 130, -1.0);
   jkPlayPOVKey(player, povfireAnim, 1, 0x38);
ChangeFireRate(player, fireWait);
	} else {
	if(busy==1) return;
	if(onegrenade==1) return;
	busy=1;
	onegrenade=1;
	jkPlayPOVKey(player,povGren,1,0x38);
	PlaySoundThing(grenadeR,player,1,-1,5,0xC0);
	SetTimerEx(GetKeyLen(povGren)/3,15,0,0);
	}

   Return;

# ........................................................................................

activated:
   player = GetSourceRef();
   mode = GetSenderRef();
   jkSetWaggle(player, '0.0 0.0 0.0', 0);
   powerBoost = GetInv(player, 63);
   ActivateWeapon( player, fireWait, mode );
   Return;

# ........................................................................................

deactivated:
   player = GetSourceRef();
   mode = GetSenderRef();
	busy=0;
   jkSetWaggle(player, '10.0 7.0 0.0', 350);
   DeactivateWeapon( player, mode );
   Return;

# ........................................................................................

selected:
   player = GetSourceRef();
	SetTimerEx(10,14,0,0);
	oldammo=GetInv(player,11);
	SetInv(player,11,GetInv(player,130));
   // Setup the meshes and models.
   jkSetPOVModel(player, povModel);
   jkSetWeaponMesh(player, weaponMesh);
   SetArmedMode(player, 1);
	SetPulse(0.01);
   // Play mounting sound.
   PlayMode(player, 41);

   // Play the animation (NOLOOP + UNIQUE + ENDPAUSE).
   // The animation is held at the last frame after it is played.
   trackID = jkPlayPOVKey(player, mountAnim, 0, 0x14);
   jkSetWaggle(player, '10.0 7.0 0.0', 350);

   // Clear saber flags, and allow activation of the weapon
   jkClearFlags(player, 0x5);
   SetCurWeapon(player, 2);
   SetMountWait(player, GetKeyLen(mountAnim));
   PlaySoundThing(mountSound, player, 1.0, -1.0, -1.0, 0x80);
   Return;

# ........................................................................................

deselected:
   player = GetSourceRef();
   weaponIndex = GetSenderRef();
   PlaySoundThing(mountSound, player, 1.0, -1.0, -1.0, 0x80);
	KillTimerEx(14);
	SetInv(player,11,oldammo);
   PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
   jkPlayPOVKey(player, dismountAnim, 0, 0x04);
   if (trackID != -1)
   {
      jkStopPOVKey(player, trackID, 1);
      trackID = -1;
   }
   SetPulse(0);
   holsterWait = GetKeyLen(holsterAnim);
   SetMountWait(player, holsterWait);
   holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
   SetTimerEx(holsterWait, 2, 0.0, 0.0);
   jkSetWaggle(player, '0.0 0.0 0.0', 0);

   Return;

# ........................................................................................

autoselect:
   player = GetSourceRef();

   // If the player has the weapon
   if(GetInv(player, 2) != 0.0)
   {
      // If the player has ammo
      if(GetInv(player, 130) != 0.0)
      {
         ReturnEx(500.0);
      }
      else
      {
         ReturnEx(-1.0);
      }
   }
   else
   {
      ReturnEx(-1.0);
   }

   Return;

# ........................................................................................

timer:
	if(GetSenderID()==15)
	{
		if(onegrenade==1)
		{
		If(GetInv(player,4)>0)
		{ 
			SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
			dummy = FireProjectile(player, projgren, grenadeF, 8, '0.0135 0.1624 0.0', '0 0 0', 5, 0x21, autoAimFOV, autoAimFOV*2);
			ChangeInv(player, 4, -1.0);
			printint(GetInv(player,4));
			print("grenades left");
		}
		else
		{
			PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
			print("EMPTY!");
		}
		onegrenade=0;
		}
	}
	else if(GetSenderID()==2)
	{
   		StopKey(player, holsterTrack, 0.0);
	}
	else if(GetSenderID()==14)
	{
		boredtrack=jkPlayPOVKey(player,povboredAnim0[rand()*2],1,0x38);
		KillTimerEx(14);
		SetTimerEx(10-(rand()*8),14,0,0);
	}
return;
pulse:
	jkSetWaggle(player, '0.0 0.0 0.0', 0);
	SetInv(player,11,GetInv(player,130));
	if(GetThingThrust(player)!=VectorSet(0,0,0))
	{
		if(bob!=-1) return;
		bob=jkPlayPOVKey(player,povBob,1,0x0);
	}
	else
	{
		if(bob==-1) return;
		jkStopPOVKey(player, bob, 1);
		bob=-1;
	}
return;
end

Here's the whole thing. Now, I believe it was refering to the other Italic line (if(GetThingThrust(player)!=VectorSet(0,0,0))) but I don't know why this.

And as I'm in the process of complaining about Parsec, how about fixing this problem about newlines in the middle of statements and verbs. For example, in force powers where you target something, there is a nice large IF statement on seperate lines, and Parsec calls it an Error! WHY? And maybe, better GUI? Either scrollable window or print it out on a text file?

/Edward
Edward's Cognative Hazards
2004-06-06, 10:02 AM #6
Line 249 is 'if(GetThingThrust(player)!=VectorSet(0,0,0))'
not the '{'

Parsec is really nice for level cogs, but it doesn't always work for weapon and force power cogs, this might be an example of this. But then again, I havn't cogged in a while so I might be wrong.

------------------
*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
2004-06-06, 10:08 AM #7
This is definitely a problem in parsec. It doesn't seem to like vectors right there for some reason. Flex variables worked fine, and they aren't ints.
(btw, I meant like "if(flex0 != flex1)", not "if(GetThingVel(player) != flex1)"

------------------
for(i = 0; i < 00; i = i + 1) Print("massassi is good");
PrintInt(i); //print the integer value of infinity (if we ever get there)

[This message has been edited by Darth Slaw (edited June 06, 2004).]
May the mass times acceleration be with you.
2004-06-06, 11:37 AM #8
Now that's funny... For when I looked at the COG with NotTab Light, it said that line 249 was {... I'll have another look. Now that was wierd... Now, NoteTab Light shows line 249 being where the problem was... *Dozes off on the keyboard, after reading the time: 23:33*
Edward's Cognative Hazards
2004-06-06, 11:45 AM #9
I use CogPad now. It was a big change from notepad, and I wish it had an plugin-slot thingie for Scribe like it does for Parsec... Sorry, went off-topic with this post. CogPad shows the line number at the top of the application window, and you can use Ctrl+G in NotePad (Go To...) to go to a line.

Maybe NotTab Light starts with Line 0 instead of Line 1?

------------------
for(i = 0; i < 00; i = i + 1) Print("massassi is good");
PrintInt(i); //print the integer value of infinity (if we ever get there)
May the mass times acceleration be with you.
2004-06-07, 4:11 AM #10
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Darth Slaw:
...I wish it had an plugin-slot thingie for Scribe like it does for Parsec......</font>


Ehehe, well, at the time I wrote CogPad, I kinda *hated* Scribe with a burning passion... But, the source is available to anyone who wants to fiddle around with it....


...Good to know someone actully uses it, though, thanks. [http://forums.massassi.net/html/wink.gif]

------------------
Dear lady, can you hear the wind blow, and did you know
Your stairway lies on the whispering wind.
:wq

[This message has been edited by GBK (edited June 07, 2004).]
And when the moment is right, I'm gonna fly a kite.
2004-06-09, 11:03 AM #11
When using the == or != sign, it can NOT be vectors. They fixed this in mots by adding the verb
Code:
VectorEqual(startpos, currentpos);

To do a vector check in JK, break up the vector into 3 different checks
ex
Code:
if(VectorX(startvec)==VectorX(currentvec) && VectorY(startvec)==VectorY(currentvec) && VectorZ(startvec)==VectorZ(currentvec))

It may be one ugly if statement, but it gets the job done.

------------------
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2004-06-09, 1:35 PM #12
Quote:
<font face="Verdana, Arial" size="2">Originally posted by SG-fan:
When using the == or != sign, it can NOT be vectors.</font>

Gee, seems like a number of things don't work in JK... GetWallCel(), vec1 == vec2,...
How annoying.
Is this in the DM?



------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.
2004-06-09, 5:06 PM #13
I'm not sure if it is exactly in the DM, but it does say that != is limited to integers only (no decimals at all).

But why would they make a verb in MOTS to check vectors if they could do it with ==?

Through my experiences with vectors (which is quite extensive due to my ship cog which I still need to e-mail DP and uh... I'll check on the other person [edit] Friend14 [/edit] [http://forums.massassi.net/html/smile.gif]) I have never gotten == and != to work and have simply used the large if statement seen in my previous post.


GetWallCel() doesn't work? Hmm, I thought I used it once, I'll have to check that...

------------------
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"

[This message has been edited by SG-fan (edited June 09, 2004).]
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2004-06-10, 12:29 AM #14
Appifiny! What about VectorDist()? No? OK, never mind then...
Edward's Cognative Hazards
2004-06-10, 10:33 AM #15
http://forums.massassi.net/html/Forum4/HTML/004147.html

According to Decent_pilot, it doesn't work. I haven't tried it for myself... had no need yet.

Well, actually, you probably could use vectordist()

not equal : if(VectorDist(vec1,vec2) > 0)
equal : if(VectorDist(vec1,vec2) == 0)

because the distance between two vectors is always greater than 1, except when they are exactly the same. At least, logic says...

------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.
2004-06-13, 3:38 PM #16
I was under the impression that VectorDist() only returned ints. But, now that I think about it, I have no idea where I got that thought. Theoretically speaking, the vectordist check should work. Theoretically...

Time for testing.

------------------
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"

↑ Up to the top!