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 → Force Defense Cog
Force Defense Cog
2002-06-02, 3:54 PM #1
I want to make a force power that replaces force protection that when you activate it you block every shot fired at you with your lightsaber, regardless if you are in the proper position to block it. Is that possible?
2002-06-03, 11:28 AM #2
Yes, it's simple, change the 'Error' part of the template in the cog. Very simple cog here. [http://forums.massassi.net/html/smile.gif]

Code:
# Sample code by Descent_pilot for hbbtstar
# Not supported by LucasArts
Symbols
Thing     Player
Flex      time           //time it takes to end the forcepower
message   activated
message   timer

Code
Activated:
   Player = GetLocalPlayerThing;  // This is the player
   ParseArg(player, "error=0.0"); // New error
   SetTimer(time);
   Return;

Timer:
   ParseArg(player, "error=0.5") // Default error
   Return;

Add whatever else you want, tint, sound, and so on and so on. [http://forums.massassi.net/html/biggrin.gif] If 'error=0.0' doesn't work use 'error=1.0' (but I think that doesn't block anything [http://forums.massassi.net/html/redface.gif]).

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-03, 12:53 PM #3
Thanks, but how do I add that cog into my game? Do I just GOB it?
2002-06-05, 4:28 AM #4
Add a line in Items.dat, and the flags 0x120. Then open JKStrings.uni and scroll down to ACTIVATE part. Add
Code:
"ACTIVATE17"      0 "Force Defense"
, update the number up top by adding 1 to it. GOB it, and run Pacth Commander. [http://forums.massassi.net/html/cool.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-05, 2:21 PM #5
*..fades in..*

Pilot, you obviously don't know what you're doing. You just gave him some flawed code for a hotkey to change his saber reflection accuracy. Now is that what Hbbtstar asked for?

Star, saber-blocking is mostly controlled by the exe. But, there are three template settings that you can use to change how the saber blocks:

error: controls the accuracy of the reflected bolt. An error of 0 will make the bolt inevitably hit the creature that fired it.

chance: a 0 to 1 value that controls the chance of kyle to reflect the bolt.

fov: stands for "field of view," but it's deceptive. It's really the minimum dot product of the direction the player is looking and the direction that the laser is coming at him. But you can think of it as a -1 to 1 scale with -1 reflecting all bolts and 1 reflecting none.

Each level gob contains a .jkl for all the levels it contains. These JKL files are text files which you can open with Wordpad. There's a section near the bottom of each JKL called "Templates." A template near the top of the list called "walkplayer" contains the information that JK needs to create Kyle ingame. In this template, the three template values for saber-blocking are defined.

The cog verb, ParseArg(), is used to modify template settings ingame when given an object that was created from the template. So, you would rewrite the FP cog and use ParseArg() commands to change the template settings while the force power is on. When the power should turn off, use ParseArg() again to give the player back his original settings.

Now, you can't make a good patch without knowing Cog, and you should write this cog yourself. If you're new to Cog, download the utilities listed in my signature (basic tutorials are included in the DataMaster). If you need help with the making of your cog or if I didn't make much sense, post again.

Glad to help. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited June 05, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-06-07, 1:05 PM #6
Thank you of correcting my mistake with the 'error'. [http://forums.massassi.net/html/redface.gif] I was planing to do somethinglike this in The X Project. I'll use this info. [http://forums.massassi.net/html/smile.gif] Once again, thank you SaberMaster.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!