Author Topic: Triggers, and FREEZE!  (Read 2024 times)

Ok, first, how do you set a left click trigger or alt trigger or trigger + key like the flak cannon and boxing gloves? And second, how do you make a player FREEZE! when hit by a certain weapon?

Alt bind:
moveMap.bind("keyboard", "alt x", "nameOfFunction");
(That will bind to 'alt x').

Left-click bind:
moveMap.bind("mouse0", "button1", "nameOfFunction");

To make a player freeze without creating a new datablock, I would change their control object, like possibly to a camera that's orbiting their player.

Ok, first, how do you set a left click trigger or alt trigger or trigger + key like the flak cannon and boxing gloves? Package out the armor::onTrigger function


And second, how do you make a player FREEZE! when hit by a certain weapon? Spawn something tiny where the player is, and mount the player to it

Alt bind:
moveMap.bind("keyboard", "alt x", "nameOfFunction");
(That will bind to 'alt x').

Left-click bind:
moveMap.bind("mouse0", "button1", "nameOfFunction");

To make a player freeze without creating a new datablock, I would change their control object, like possibly to a camera that's orbiting their player.
But, how do you make it so that when you do that, something happens. And can you have a melee weapon for one trigger, and a thrown weapon for the second? if so, how?

Bump, but also, what is the color in text in scripts? like "123 123 123" is it RGB?
« Last Edit: February 19, 2008, 07:14:49 PM by jake99999999 »


Ok, first, how do you set a left click trigger or alt trigger or trigger + key like the flak cannon and boxing gloves? Package out the armor::onTrigger function


And second, how do you make a player FREEZE! when hit by a certain weapon? Spawn something tiny where the player is, and mount the player to it, schedule a function to set velocity to zero and move player back to where he was frozen or change the player datablock
colored text:
\c#
example:
"\c0 OMG OMG OMG"
"\c4 OMG OMG OMG"
goes up to \c9

Ok, first, how do you set a left click trigger or alt trigger or trigger + key like the flak cannon and boxing gloves? Package out the armor::onTrigger function


And second, how do you make a player FREEZE! when hit by a certain weapon? Spawn something tiny where the player is, and mount the player to it, schedule a function to set velocity to zero and move player back to where he was frozen or change the player datablock
colored text:
\c#
example:
"\c0 OMG OMG OMG"
"\c4 OMG OMG OMG"
goes up to \c9
No, no, no. Like in a script, when it says
Code: [Select]
colors[0]     = "1 1 0.0 0.9";what is the "1 1 0.0 0.9"? is it the RGB?
Yay! I'm Actually making pretty god-scripted weapons and I'm only 10!
« Last Edit: February 19, 2008, 08:29:03 PM by jake99999999 »

Oh, thats RGBA
Red blue green alpha(transparency)

hmmmmm.... I will try, but still, can you make one trigger (let's say trigger1) be a melee weapon and trigger2 be a thrown weapon?

Alt bind:
moveMap.bind("keyboard", "alt x", "nameOfFunction");
(That will bind to 'alt x').

Left-click bind:
moveMap.bind("mouse0", "button1", "nameOfFunction");

To make a player freeze without creating a new datablock, I would change their control object, like possibly to a camera that's orbiting their player.
Ummm....
Code: [Select]
Could not create a description for binding: mouse0

Dont listen to exidyne.

Just look at the loving guns that have right click functions.

The only thing I could find in common was this....
Code: [Select]
package FlakCannon
{
function armor::onTrigger(%this,%player,%slot,%val)
{
if(%slot $= 4 && %player.getMountedImage(0) $= flakImage.getID())
{
if(%val)
{
%player.setImageAmmo(0,0);
%player.setImageTrigger(0,1);
%player.setImageTrigger(0,0);
%player.setImageAmmo(0,1);
}
}
else
Parent::onTrigger(%this,%player,%slot,%val);
}
};
ActivatePackage(FlakCannon);
and this
Code: [Select]
function Armor::onTrigger(%this,%player,%slot,%trigger)
 {
   if(%slot !$= "4" || checkforgloves(%player) == 0){Parent::onTrigger(%this,%player,%slot,%trigger);return;}
     if (%player.blocking == 0 && %player.punching == 0  && %player.justpunched != 1)
     {
  %player.blocking = 1;
  %player.unmountImage(0);
  %player.unmountImage(1);
  %player.hideNode(lhand);
  %player.hideNode(rhand);
  %player.mountImage(boxingglovesBlockImage,0);
  %player.playthread(2,armreadyleft);
     }
     else if (%player.blocking == 1)
     {
      %player.blocking = 0;
  %player.unmountImage(0);
      %player.mountImage(boxingglovesRightImage, 0);
  %player.playthread(2,armreadyleft);
     }

if (%slot $= "4" && %player.punching == 1)
     {
%player.justpunched = 1;
}
else if (%slot $= "4" && %player.punching == 0)
{
  %player.justpunched = 0;
}
  }

Well thats pretty much what you needed to find.

ok, I'll give it all I got to make it if not, THEN, I MIGHT need some help