- Quick Links - |
Visitor No.72282 |
- Random Picture - | ||||||
|
Creating Tertiary Fire Mode
This tutorial will cover the method of creating a tertiary fire mode on a weapon. Where usually are 2 modes of firing on each weapons. It will use a new hotkey and when pressed it will do various actions according to the weapon the player is holding. In detail, the new hotkey will call message "user0" in the weapon cog and do the third action.
First, let's start editing from the weapon cog. We'll have the following examples.
Open up weap_raildet.cog and weap_saber.cog. Add user0 message in the symbols and to just before the "end" of the cog. We'll make the rail detonator weapon swingable with the tertiary fire mode. Paste the following lines in the user0 message. jkPlayPOVKey(player, povswinganim, 2, 0x38); //Does POV animations (For internal view mode) PlayKey(player, swinganim, 2, 0x38); //Does external animations (For external view mode) PlaySoundThing(swingsound, player, 1.0, -1, -1, 0x80); //Play swinging sound SetFireWait(player, firewait + 0.5); //Set fire wait, so you won't be able to fire during the swing SetBinWait(player, 116, GetKeyLen(swinganim)); //Set tertiary fire bin to stay, so you won't be able to swing so fast FireProjectile(GetParam(0), swing, -1, 8, '-0.02 0.03 0', '0 0 0', 1.0, 0, 0.0, 0.0); //Fire the projectile. return; //End the user0 message Now whenever user0 message gets called, player will swing the rail detonator. Just before moving onto the saber cog, make sure to put the following lines in the symbols. In this case, I'm using "+gamaxe" as the firing template, but in a level that has no such template in jkl file will make this cog not to work. If you want a template that works in every level, you have to get the static.jkl and paste the "+gamaxe" template from the master.tpl that comes with JED along with its parents. keyframe swinganim=KYsabrf1.key local keyframe povswinganim=SabVf1.key local sound swingsound=swingfist02.wav local template railSwing=+gamaxe local
Let's move onto the weap_saber.cog. In the user0 message, add the following. SetInv(player, 10, 0); //No more saber in inventory SetFireWait(player, -1); //Cancel fire wait SetMountWait(player, 0); //Not mounting the weap SetCurInvWeapon(player, 0); //don't know =P SelectWeapon(player, 1); //Thrown. Fist as your weap now if (mountAnimID != -1) //Stop if while mounting { jkStopPOVKey(player, mountAnimID, 0); mountAnimID = -1; } jkSetWaggle(player, '0.0 0.0 0.0', 0); //Don't shake //Cancel saber cog elements slash = 0; nextAttack = 0; slashAnimID = -1; povSlashAnimID = -1; //Don't hum if(humChannel != -1) { StopSound(humChannel, 0.5); humChannel = -1; } //Stop timers if working KillTimerEx(0); KillTimerEx(1); ClearActorFlags(player, 0x2000); //No more laser reflections jkDisableSaber(player); //No more clashings on walls and sabers nosaber = 1; //That's right, you threw it. FireProjectile(player, saberProj, throwSound, 8, '0.0135 0 0', '0 0 0', 1, 0x20, 30, 60); //Throw the saber with good control return; That will throw the saber. Add the following in the symbols. template saberProj=+force_saber local sound throwSound=ltsaberswing08.wav local That was all for weapon cog modifying. Now to the trigger hotkey cog.
You only need another cog that will trigger these user0 messages as a hotkey to make the tertiary fire mode work along with items.dat and jkstrings.uni. Create a new cog and place activated message. Just add the following line. SendMessage(GetInvCog(GetSourceRef(), GetCurWeapon(GetSourceRef())), user0); This will call message user0 to the cog that the player is holding. In items.dat add this line below bin 115. This will register the cog as a hotkey'able bin. Third_Fire 116 0 1 0x120 cog=thirdfire.cog Last, in jkstrings.uni, place this line below ACTIVATE16 in the file. This will list the new entry in the key configuration screen. "ACTIVATE17" 0 "Third Fire"
All done. Load up JK and assign the hotkey and press! Make sure you use "red5" in the cheat, because weapons other than raildet and saber does nothing with this.
|
This site is developed using PHP under Apache server Certain parts of this site require Cookie support. This site is best viewed with
Internet Explorer 5.5, Netscape 6.0, Opera 6.0 or Mozilla 1.0 and above |