Author Topic: Secondary Funtion: Mode Change  (Read 844 times)

I have a plan to make it, so when I right click, I change my weapon's mode of firing.
I was planning on making something like an Enable/Disable thing.
Like, if I right click then it would enable something like this:
Code: [Select]
stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "Fire";
stateAllowImageChange[1]         = true;
stateSequence[1] = "Ready";

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Smoke";
stateTimeoutValue[2]            = 0.14;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = GlockFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = GlockShot1Sound;
stateEjectShell[2]       = true;

stateName[3] = "Smoke";
stateEmitter[3] = GlockSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";
Only I would have it repeat to fire more.
Does anyone have any idea how to do this?

Code: [Select]
stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "ToggleMode";

stateScript[2]                  = "ToggleMode";
Then you just make your WeaponImage::ToggleMode(%this) and make it do a different thing for each mode its in.


Code: [Select]
stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "ToggleMode";

stateScript[2]                  = "ToggleMode";
Then you just make your WeaponImage::ToggleMode(%this) and make it do a different thing for each mode its in.


It looks like it's for when you click the left mouse button. I must be crazy.
So I create a section with the WeaponImage::ToggleMode(%this), with the things I want below, like how I explained?

I mean, I need something like that, that makes so either that I right click, or press a button to change the mode at any time I need. Then create the function of what it does in that mode.
« Last Edit: December 06, 2008, 04:37:39 AM by Azerath »

Try looking at the scripts and states for the Portal Gun, Gravity Gun or the v8 Flak Cannon if you have it.

Try looking at the scripts and states for the Portal Gun, Gravity Gun or the v8 Flak Cannon if you have it.
I do, and I'm still kinda confused.
I saw this in the Portal Gun Script:
Code: [Select]
function altPortalFire(%this,%obj,%slot,%on)
{
 if(%obj.getImageState(0) !$= "Ready")
 {
  return;
 }
 %obj.fireOrangePortal = 1;
 %obj.setImageTrigger(0,1);
}
So this is kinda what I'm looking for right? It just stated that if I press a certain trigger button that it will activate the state:
Code: [Select]
stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "ToggleMode";

stateScript[2]                  = "ToggleMode";

I have a plan to make it, so when I right click, I change my weapon's mode of firing.
I was planning on making something like an Enable/Disable thing.
Like, if I right click then it would enable something like this:

the code that i dont wanna copy

Only I would have it repeat to fire more.
Does anyone have any idea how to do this?

well I dont think that would work out because you would have to set it to the jet button so not everyone's would be right click (sry if you get rly mad at this post)

well I dont think that would work out because you would have to set it to the jet button so not everyone's would be right click (sry if you get rly mad at this post)
*sigh*