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 → Not sticky enough?
Not sticky enough?
2001-10-22, 1:51 PM #1
I was writing a send trigger cog for my patch. Anyway, I created a new template. And as you all know, new templates need SendTrigger messages in a separate cog. Well this cog was supposed to make the template and attach it to the player. I've narrowed it down to this cog. I know it's this cog but I'm not sure how to fix it. It makes the template stick to you on some levels such as Canyon Oasis. But for some levels I've tested it on like level 13 in JK. Or Boc's level. Anyway the template is generated but you can walk out of it. Is it not sticky enough? Any ideas. I'm suffering head trama from bashing my head against the keyboard so many times so please help. Thanks guys. Here's the cog.

Code:
# Jedi Knight Cog Script
#
# Client_Persuasion.COG
#
# 
# 
#
# This Cog is Not supported by LucasArts Entertainment Co

# This flag makes the cog act locally, no broadcasting, less lag.
flags=0x404

symbols

flex            autoAimFOV=30                   local
flex            autoAimMaxDist=5                local
template        sphere_tpl=+f_quicksilver       local
template        quicksilver=+quicksilver        local

message         trigger
                     

end

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

code

trigger:

        if (GetSourceRef() == 290)  
        {
         sphere = FireProjectile(GetParam(0), sphere_tpl, -1, -8,  '0.0 0.0 0.0', '0 0 0', 1.0, 0x30, 0, 2);
	 AttachThingToThingEx(sphere, player, 0x8);

	}
        else if(GetSourceRef() == 291)
        {
   	 qs = FireProjectile(GetParam(0), quicksilver, -1, -8,  '0.0 0.0 0.0',  GetParam(1), 1.0, 0x30, 0, 2);
	 AttachThingToThingEx(qs, player, 0x8);
        }
           
        return;

end
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-10-22, 8:16 PM #2
Make the cog flags 0x240
2001-10-23, 5:06 AM #3
It would problably help if you defined 'sphere', 'qs', and 'player'...

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-23, 12:22 PM #4
I got the 5000th post! Anyway what do you mean define? How would I? I thought I already did.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-10-23, 1:18 PM #5
you left them out of the symbols..
2001-10-24, 11:34 AM #6
I added them to the symbols and made the flags 0x204. Still nothing.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-10-24, 7:45 PM #7
0x240 !

Post the whole cog here again...
2001-10-25, 6:34 AM #8
I did change the flags to 0x240. I will post it once I get home. I'm on the school computer.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-10-25, 4:25 PM #9
It may be interfering with the trigger ID in those levels, try changing those 290's into something so big or small around 10's, for a try.

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited October 25, 2001).]
2001-10-26, 2:01 PM #10
You have a point there Hideki. I never thought of that. Anyway here's the updated cog.

Code:
# Jedi Knight Cog Script
#
# Client_Persuasion.COG
#
# 
# 
#
# This Cog is Not supported by LucasArts Entertainment Co

# This flag makes the cog act locally, no broadcasting, less lag.
flags=0x240

symbols

thing           player                          local
flex            autoAimFOV=30                   local
flex            autoAimMaxDist=5                local
template        sphere_tpl=+f_quicksilver       local
template        quicksilver=+quicksilver        local
int             sphere=-1                       local
int             qs=-1                           local

message         trigger
                     

end

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

code

trigger:

        if (GetSourceRef() == 290)  
        {
         sphere = FireProjectile(GetParam(0), sphere_tpl, -1, -8,  '0.0 0.0 0.0', '0 0 0', 1.0, 0x30, 0, 2);
	 AttachThingToThingEx(sphere, player, 0x8);

	}
        else if(GetSourceRef() == 291)
        {
   	 qs = FireProjectile(GetParam(0), quicksilver, -1, -8,  '0.0 0.0 0.0',  GetParam(1), 1.0, 0x30, 0, 2);
	 AttachThingToThingEx(qs, player, 0x8);
        }
           
        return;

end


[This message has been edited by LordX-T_IJ (edited October 26, 2001).]
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-10-28, 9:21 AM #11
Well there it is.
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-10-28, 11:44 AM #12
Your still not defining 'player' in the CODE anywhere. I dont know if you intend:

player = GetParam(0);

or

player = GetLocalPlayerThing();

but you need indentify it both in symbols and in code sections.
- Wisdom is 99% experience, 1% knowledge. -
2001-10-28, 1:43 PM #13
I now know what I should've known on your first cog post, thanks to the above post.

It says AttachThingToThingEx(sphere, player, 0x8); where there is no "player" defined, use GetParam(0) in there instead.

And probably not the trigger ID stuff, which you haven't made a change anyway.

------------------
http://millennium.massassi.net/ - Millennium
2001-10-28, 2:59 PM #14
Ya Hideki I changed the ID number later but it didn't work. So I changed it back to 290 and 291. That's why I edited the post as you can see. Thanks guys, I'm sorry for being so stupid. Thank you a lot!
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-10-29, 4:53 PM #15
nothing has to be defined in the symbols unless it will be template, surface, sector, material, sound, or other variables. Even then, LoadModel, LoadTemplate, LoadSound, etc. work as well. you could easily have:

symbols
message startup
end
code
startup:
player = getlocalplayerthing();
victim = firstthinginview(player, 179,179,0x404);
if(getactorflags(victim) & 0x200) call piss_ur_pants;
return;

piss_ur_pants:
call elmo;
return;

elmo:
call peter;
return;

peter:
call elmo; // muahaha this makes a loop and might crash the game!
return;

end
2001-10-30, 8:28 AM #16
You are correct about not needing to define most values in symbols, however I wish to point out a small error in your understanding of COG. Try this:

Code:
symbols
message startup
end
code
startup:
player = getlocalplayerthing();
victim = firstthinginview(player, 179,179,0x404);
if(getactorflags(victim) & 0x200) call piss_ur_pants;
return;

piss_ur_pants:
call elmo;
return;

elmo:
Print("STRIKE's ELITE LOOP");
call peter;
return;

peter:
call elmo; // muahaha this makes a loop and might crash the game!
return;

end 


To most peoples suprise instead of creating a never ending loop it only prints "STIKES ELITE LOOP" twice. This is because when JK compiles cog it really treats the call statements similar to this:

if(RUN == 0)
{
RUN = 1;
call peter;
}

meaning call statements are only issued once. Then ignored. Your cog is in no risk of crashing the game. The effect is different in pulse: however, it will keep issuing the call; every pulse.

------------------
- Wisdom is 99% experience, 1% knowledge. -



[This message has been edited by The_New_Guy (edited October 30, 2001).]
- Wisdom is 99% experience, 1% knowledge. -
2001-10-31, 12:55 AM #17
That's a new stuff (to me at least).

------------------
http://millennium.massassi.net/ - Millennium
2001-10-31, 2:49 AM #18
Try it [http://forums.massassi.net/html/wink.gif]

------------------
- Wisdom is 99% experience, 1% knowledge. -
- Wisdom is 99% experience, 1% knowledge. -
2001-10-31, 4:47 AM #19
Yes, Ive tried making loops out of calls before, dosnt work.

And Strike, it has been my expiriance that an Int or Object doesnt have to be defined, IF the same Int or Object are defined in another cog in the same JKL file. IF they arent, it doesnt work.

 



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!