PDA

View Full Version : Force Defense Cog



hbbtstar
06-02-2002, 06:54 PM
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?

Descent_pilot
06-03-2002, 02:28 PM
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



# 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

hbbtstar
06-03-2002, 03:53 PM
Thanks, but how do I add that cog into my game? Do I just GOB it?

Descent_pilot
06-05-2002, 07:28 AM
Add a line in Items.dat, and the flags 0x120. Then open JKStrings.uni and scroll down to ACTIVATE part. Add
"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

SaberMaster
06-05-2002, 05:21 PM
*..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 (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

[This message has been edited by SaberMaster (edited June 05, 2002).]

Descent_pilot
06-07-2002, 04:05 PM
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