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 → Saber Cog
Saber Cog
2005-08-30, 3:28 PM #1
this cog lets you change the templates and testures(woohoo!) of your lightsaber

Code:
# Jedi Knight Cog Script
# 
# saber.cog
# 
# Changes the texture and Templates of a lightsaber in SP levels.
# 2005 Reid Booth
# invader_scoog@yahoo.com
# 
# This cog is not supported by LEC

symbols
message		startup
message		timer

material	SaberTip=saberpurple0.mat
material	SaberSide=saberpurple1.mat

template	tpl_wall=+ssparks_wall.tpl
template	tpl_blood=+ssparks_blood.tpl
template	tpl_saber=+ssparks_saber.tpl

int		player			local
end
# ------------------------------------------------------

code
# ------------------------------------------------------
startup:
	{
		setTimer(0.5);
	}
	return;
# ------------------------------------------------------
timer:
	{
		jkSetSaberInfo(getLocalPlayerThing(), SaberTip, SaberSide, 0.003, 0.001, 0.120, tpl_wall, tpl_blood, tpl_saber);
	}
	return;
end
2005-08-30, 5:04 PM #2
So? That's one of the most trvial bits of cog I've ever seen.
2005-08-30, 6:45 PM #3
Originally posted by JM:
So? That's one of the most trvial bits of cog I've ever seen.

Not everyone can cog. Don't be an *******.
</sarcasm>
<Anovis> mmmm I wanna lick your wet, Mentis.
__________
2005-08-30, 11:42 PM #4
[QUOTE=Compos Mentis]Don't be an *******.[/QUOTE]
This is like telling someone not to breathe. Hehe, I joined the "pick on JM" bandwagen, woo!
The jkSetSaberInfo could also be placed in the startup message with a short Sleep in front of it.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-08-31, 6:55 AM #5
Ah yes, but thats the way LEC did it(I just used theirs as an example)
2005-08-31, 4:53 PM #6
Originally posted by Reid:
Ah yes, but thats the way LEC did it(I just used theirs as an example)


Wait, that was LEC code? Why did you post this? :confused:
And when the moment is right, I'm gonna fly a kite.
2005-08-31, 5:09 PM #7
No its not, I made it from scratch.

I just used theirs as an example, as stated earlier.
I did no copying annd pasting or editing of any cog, it's all done from scratch.
Thats why mine is the way it is.

Code:
# Jedi Knight Cog Script
# 
# saber.cog
# 
# Changes the texture and Templates of a lightsaber in SP levels.
# 2005 Reid Booth
# invader_scoog@yahoo.com
# 
# This cog is not supported by LEC
# ----------------------------------------------------------------------------------------------
symbols
message		startup

material	SaberTip=saberpurple0.mat
material	SaberSide=saberpurple1.mat

template	tpl_wall=+ssparks_wall
template	tpl_blood=+ssparks_blood
template	tpl_saber=+ssparks_saber

int		player			local
end
# ----------------------------------------------------------------------------------------------
startup:
	{
		sleep(0.5);
		jkSetSaberInfo(getLocalPlayerThing(), SaberTip, SaberSide, 0.003, 0.001, 0.120, tpl_wall, tpl_blood, tpl_saber);
	}
	return;
end

^Newer version^

BTW I've only been cogging for a week so yes im a n00b.
2005-09-01, 12:27 AM #8
Now paste the code into item_wrench.cog or some other existing sp cog that works in mp, and have Compos Mentis or Quib_Mask help you in making it pass checksum.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-09-03, 10:05 PM #9
I'll make it pass checksum if you want, but I don't see why you would want to.
2005-09-04, 4:36 AM #10
Hmm, you're right, doesn't make sense, since custom templates/textures wouldn't pass checksum anyway...
Oh well, but you could run around with a dflt textured lightsaber that explodes on impact.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-09-04, 7:05 AM #11
Actually, I'm confused. What is a custom template for saber? Like custom wall, blood, and saber templates for the last three params of jkSetSaberInfo() ?

I can see how you would want to change your saber texture ingame, which is easily enough done, but template, that seems pointless.

Adding to my confusion I don't understand how a cog like this would work in a startup message...

Hehe I'm just one confused guy!

ReT
2005-09-04, 9:16 AM #12
Well, you can "hardcode" the desired textures and templates (in the symbols section), then launch the game. No big deal. Nothing to get confused about (it's probably the simplicity that got you confused).
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-09-04, 11:36 AM #13
You can change the size of the saber, like make it 3 feet long or 3 feet thick.
2005-09-04, 11:47 AM #14
Originally posted by zagibu:
Hmm, you're right, doesn't make sense, since custom templates/textures wouldn't pass checksum anyway...
Oh well, but you could run around with a dflt textured lightsaber that explodes on impact.

Custom templates and materials do pass checksum; the limitation on templates is usually you can't use class COGs on your custom templates, and they won't sync up (both because the other player wouldn't have the templates and because static.jkl templates simply don't sync in the first place). With materials, you'll see them, other players will see dflt.mat.

I wonder if default explosion templates applied to the lightsaber sync up over MP or if you'd only experience them client-side.

Originally posted by zagibu:
Now paste the code into item_wrench.cog or some other existing sp cog that works in mp, and have Compos Mentis or Quib_Mask help you in making it pass checksum.

Unfortunately there's not enough free code in any of the key item COGs to implement this code; you'd have to modify one of the meatier COGs to get this to work.

Originally posted by ReT:
Adding to my confusion I don't understand how a cog like this would work in a startup message...

I think the idea is so your customization would be applied every time you played, without having to activate anything.

QM
2005-09-05, 1:12 PM #15
I just did that for, well someone might want to change the templates.

I'll see what I can do for mp, but...
2005-09-05, 6:58 PM #16
Ok, being my lazy self I did not test the newer version. It does not work! The one with the Timer message does but not the sleep one.
[EDIT]Slap me I didn't put in a code section
2005-09-05, 7:53 PM #17
Whoa I was messing around and created a crazy hack with jkSetSaberInfo();
set the templates to something like +sequancer_exp
Just put it in a sp cog that works for mp
Code:
# MOTS Cog Script
# 
# saber.cog
# 
# Changes the texture and Templates of a lightsaber in SP levels.
# 2005 Reid Booth
# invader_scoog@yahoo.com
# 
# This cog is not supported by LEC
# ----------------------------------------------------------------------------------------------
symbols
message		startup

material	SaberTip=saberpurple0.mat
material	SaberSide=saberpurple1.mat

template	tpl_wall=+ssparks_wall
template	tpl_blood=+ssparks_blood
template	tpl_saber=+ssparks_saber

int		player			local
end
# ----------------------------------------------------------------------------------------------
code
# ----------------------------------------------------------------------------------------------
startup:
	{
		sleep(0.5);
		jkSetSaberInfo(getLocalPlayerThing(), SaberTip, SaberSide, 0.003, 0.001, 0.120, tpl_wall, tpl_blood, tpl_saber); //Sets the Saber info
		setThingHealth(GetLocalPlayerThing(), 999999999); //Sets the playr health to 999999999
	}
	return;
end

↑ Up to the top!