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 → Some syntax errors that i can't fix
Some syntax errors that i can't fix
2001-05-16, 3:22 PM #1
okay i majorly simplified the kyle cog to work for what i need. I think my converting it to multiplayer only should work, but i keep getting errors from the the cog check feature in cogwriter. they are variable, function or keyword expected but init_multi_kyle found another one is unexpected end of file, and the last one is noend of code section

here is my code
Code:
# Jedi Knight Cog Script
#
# KYLE.COG
#
# Main script for the player. Handles things like saber info,
# saber blocking animations, invulnerability at respawn, etc.
#
# [YB & CYW]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved

symbols

thing       player                           local

int         playersector                     local
vector      playerpos                        local
int         bub                              local

template    teleport_particles=+telesparks   local
sound       teleportsnd=ForceThrow01.WAV     local

template    bubble_tpl=bubble                local
template    bubble_tpl2=bubble2              local
template    bubble_tpl3=bubble3              local

message     startup
message     killed
message     newplayer
message     timer
message     damaged


end

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

code

startup:
   player = GetLocalPlayerThing();

   call init_multi_kyle;

      SetTimerEx(4 + 5 * rand(), 2, 0, 0);

   Return;

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

killed:
   if(player != GetSenderRef()) Return;
      ClearActorFlags(player, 0x2000);
      ClearActorFlags(player, 0x40000);

   Return;

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

damaged:
   if(GetParam(1) == 32) call make_bubbles;

   ReturnEx(GetParam(0));
   Return;

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

make_bubbles:
   playersector = GetThingSector(player);
   playerpos    = VectorAdd(GetThingPos(player), '0 0 0.075');

   for(bub = 1; bub < 1 + 3 * rand(); bub = bub + 1)
   {
      CreateThingAtPosNR(bubble_tpl[3 * rand()], playersector, VectorAdd(playerpos, VectorScale(VectorNorm(VectorSet(rand()-0.5, rand()-0.5, rand()-0.5)), 0.05)), '0 0 0');
      Sleep(0.05);

         CreateThingAtPos(bubble_tpl3, playersector, VectorAdd(playerpos, VectorScale(VectorNorm(VectorSet(rand()-0.5, rand()-0.5, rand()-0.5)), 0.05)), '0 0 0');
         Sleep(0.05);
      
   }

   Return;

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

newplayer:

   call init_multi_kyle;


   SetTimerEx(2 + 5 * rand(), 2, 0, 0);

   Return;

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

timer:
   if(GetSenderId() == 1)                    
   {
      ClearActorFlags(GetParam(0), 8);
      Return;
   }
   else
   if(GetSenderId() == 2)                   
   {
      if(GetThingHealth(player) < 1) Return;

      if((GetThingFlags(player) & 0x2000000) && !(GetPhysicsFlags(player) & 0x100000))
         call make_bubbles;
         SetTimerEx(4 + 5 * rand(), 2, 0, 0);

      Return;

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

init_multi_kyle:

   dummy = CreateThingAtPos(teleport_particles, GetThingSector(player), GetThingPos(player), '0 0 0');
   dummy = PlaySoundThing(teleportsnd, player, 1.0, -1, -1, 0x180);

   Return;

end

hope u can help since they are simple syntax errors

------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-05-16, 6:28 PM #2
You're missing one or more brackets from the "if(GetSenderId() == 2)" section in your timer.

------------------
The enemy is in front of us, behind us, to the left, and to the right. This time they won't get away.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-05-17, 11:05 AM #3
OKay thanks i can't believe i missed that one bracket, it was only one. It was really annoying trying to find what was wrong and now i am mad at myself for it being that simple.

------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-05-17, 11:15 AM #4
Get Cog Writer, it has a syntax checker that catches things like that.

------------------
Together we stand.
Divided we fall.
2001-05-17, 2:23 PM #5
yeah i was using cogwriter and i check and saw that there was a beacket missing just i coulnd't find where it was

------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-05-17, 3:25 PM #6
It highlights them.

------------------
Together we stand.
Divided we fall.
2001-05-17, 3:45 PM #7
it highlighted what message but not the verb or anything even after it highlighted the message i didn't find the missing bracket

------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!

↑ Up to the top!