Author Topic: taking event requests  (Read 3407 times)

This format please
Code: (Request) [Select]
Type: (input/output)
Name:
Description:

Code: (Example for idiots) [Select]
Type: Input
Name: onVehicleClicked
Description:
Called when a player clicks a vehicle

Code: (Other example) [Select]
Type: Output
Name: Player>toFarlands
Description:
Warps a player to the farlands

Formatting:
Type - Must be input or output
Name - Input: onName, Output: Classname>Name
Description - details that can help me code this

Classname:
Client, Brick, Minigame, Holebot, Player

if you don't follow these guidelines, I won't even reply to you.


Edit:

If the event isn't directly related to the brick, explain how you want it to be called
If you say "Every brick with the event" I will ignore you

Examples of NOT related to brick:
onPlayerUseItem - When a player uses an item
onChatMessage - When a player sends a chat message

Examples of how it should be called
When a player is standing over a brick with the event
(no other ideas)

I don't want you do suggest events not related to a brick, so please try not to...
« Last Edit: October 27, 2013, 11:18:53 PM by MARBLE MAN »

make these
Code: [Select]
Type: Input
Name: onVehicleClicked
Description:
Called when a player clicks a vehicle
Code: [Select]
Type: Output
Name: Player>toFarlands
Description:
Warps a player to the farlands
(im srs. the first one is good)
and this
Code: [Select]
Type: Output
Name: setTimescale
Class: Minigame AND Client, but they do different things
Description
Minigame > setTimescale
Sets timescale of every client in the minigame. should have server option to be admin only
Client > setTimescale
Sets timescale of a given client. should have server option to be admin only that is independent of the other one
Code: [Select]
Type: Output
Name: bot/player > mountObject
Description: like forget if I know how you'll pull this off. i had trouble with it. perhaps mounting the bot TO a named vehicle brick's object, and vice versa, mounting a named vehicle brick's vehicle to the bot?
« Last Edit: October 26, 2013, 05:13:22 PM by Lugnut »

make these
Code: [Select]
Type: Input
Name: onVehicleClicked
Description:
Called when a player clicks a vehicle
Code: [Select]
Type: Output
Name: Player>toFarlands
Description:
Warps a player to the farlands
(im srs. the first one is good)
and this
Code: [Select]
Type: Output
Name: setTimescale
Class: Minigame AND Client, but they do different things
Description
Minigame > setTimescale
Sets timescale of every client in the minigame. should have server option to be admin only
Client > setTimescale
Sets timescale of a given client. should have server option to be admin only that is independent of the other one
Code: [Select]
Type: Output
Name: bot/player > mountObject
Description: like forget if I know how you'll pull this off. i had trouble with it. perhaps mounting the bot TO a named vehicle brick's object, and vice versa, mounting a named vehicle brick's vehicle to the bot?
1
Code: (2) [Select]
registerOutputEvent("Player","toFarlands","list North 0 South 1 East 2 West 3");
function Player::toFarlands(%obj,%dir,%client)
{
   switch(%dir)
   {
      case 0:
         %pos="0 1000000 1";
      case 1:
         %pos="0 -1000000 1";
      case 2:
         %pos="1000000 0 1";
      case 3:
         %pos="-1000000 0 1";
      default:
         %pos="0 1000000 1";
   }
   %Obj.setTransform(%pos);
}

3 = bad idea - failed previously
4 = you made it? + no good way of implementing this

Can I suggest a pack?

Request 1:

Code: [Select]
Type:  Output
Target Type:  Client
Name:  LargeMsgBoxOK
Description:  Gives a large message box OK, much like the old one.  Also allows for significantly more amount of text to be entered.

Request 2:

Code: [Select]
Message leaving.

Type:  Output
Target Type:  Self/Named Brick
Name:  LeaveMessage
Description:  When called, it pulls up a GUI giving a blank for a subject and the text body.  Players enter a message and subject.  Once done, the player can click 3 buttons; Send, Preview, and Cancel.  Messages would be stored in the brick.

Type:  Output
Target Type:  Client
Name:  ViewMessages
Description:  Once triggered, the player will be able to view or delete messages from a menu.

Type:  Input
Target Type:  All
Name:  OnMsgSent
Description:  Triggered when a player sends a message.

Type:  Input
Target Type:  All
Name:  OnMsgReadBegin
Description:  Triggered when a player begins reading messages.

Other info:  For sending or receiving messages, it would be nice to have a drop-down menu with restrictions and a text box for defining the former's parameters.

Request 3:

Code: [Select]
Keybind Events

Type:  Input
Target Type:  Self/Named Brick
Name:  onKeybindHit*
Description:  Called when a user triggers a keybind from a list of keybinds.

Type:  Output
Target Type:  Self/Named Brick
Name:  ifKeybindX*
Description:  Checks which keybind is triggered.

*gives keybinds 0-1, and should check have the range-parameter like in VCE.
Other notes:  

Code: [Select]
Type - Input
Name - Input: KillBrick
Description - Kills a brick, not fakekill

i'm not sure if Input is right so

Type - output
Name - Brick>KillBrick
Description -kills a brick
« Last Edit: October 27, 2013, 11:16:53 AM by NalNalas »


Code: (OnBotDetect) [Select]
Type: Input
Name: onbotDetect>[PLAYER/HOLEBOT/VEHICLE/TEAM]>output
Description:
Triggered when a bot becomes aware of an entity. Targets are self(brick) or bot.
e.g.
onbotDetect>[TEAM][Mercenary][POOPLORDS]>Bot>kill
or
onbotDetect>[PLAYER]>self>setemitter>Fog B
or
onbotDetect>[PLAYER]>holebot>setWeapon>Sword

I think I may have formatted this wrong. Sorry.

Code: [Select]
Type: Output
Name: Minigame>VCE_ModVariableAll
Description: Modifies a specified variable on all players in the minigame.

Here's how I'd like the parameters to be (but not necessarily how I feel they should be) formatted:

[VCE_ModVariableAll] [Client/Player] [Variable] [Operation] [Amount]

1.1 exists as "Prompt events" or something
2 needs a client mod and I'm not up for that right now..
3 also needs a client mod, and I'm not up for that right now...

It was failed before, I'm not making it...

TEAM isn't a valid classname

registerInputEvent("fxDTSBrick", "onBotEngaged", "Self fxDTSBrick" TAB "Bot Bot" TAB "MiniGame MiniGame");
package botDetect
{
   function Armor::onTargetEngaged( %this, %obj )
   {
      Parent::onTargetEngaged( %this, %obj );
      if(!isObject(%obj.spawnBrick))
         return;
      %client = %obj.spawnBrick.getGroup().client;
      $InputTarget_["Self"]   = %obj.spawnBrick;
      $InputTarget_["Bot"]   = %obj;
      $InputTarget_["MiniGame"] = getMiniGameFromObject(%obj);
      %obj.processInputEvent("onBotEngaged", %client);
   }
};
activatepackage(botDetect);

this will call the event when a something comes into the bot's view distance

vce is a force not to be reckoned with
It's written weirdly and it's creator is not content with it.
sorry

Type: Input
Name: OnPlayerUseCaps
Description:
Does something if a player types in all caps.

Type: Output
Name: Kick
Description:
Kicks the player

Type: Output
Name: Ban - 1/1/1/Forever
                 M D Y    
Description:
Bans the player for 0-100 months 0-100 days and 0-100 years or Forever


All having an RTB pref. for making these None/Admin/SuperAdmin/Host only
« Last Edit: October 28, 2013, 02:39:56 PM by Ducky duck »

Type: Input
Name: onMinigameActivate
Description: Called when a player clicks another player, and has two special outputs:
Activator
ActivatorClient
I think they're kinda obvious.


you're an idiot.
how would I link this to a brick?

It's not specific to the brick, it's like the other onMinigame_____ events.

It's not specific to the brick, it's like the other onMinigame_____ events.

registerInputEvent(fxDtsBrick,"onMinigameActivate","Self fxDtsBrick\tTargetPlayer Player\tTargetClient GameConnection\tSourcePlayer Player\tSourceClient GameConnection\tMinigame Minigame");
$Event_Minigame::onMinigameActivateList = inputEvent_GetInputEventIdx("onMinigameActivate");
package Event_MinigameActivate
{
   function Player::ActivateStuff(%obj)
   {
      %r=containerRaycast(%obj.getEyePoint(),vectorAdd(%obj.getEyePoint(),vectorScale(%obj.getEyeVector(),10)),%mask,%obj);
      if(isObject(%col=firstWord(%r)))
      {
         if(!isObject(%col.client)||!isObject(%obj.client))
            return;
         if(getMinigameFromObject(%col)==%mini=getMinigameFromObject(%obj))
         {
            for(%i=0;%i<getWordCount($Event_Minigame::onMinigameActivateList);%i++)
            {
               %brick = getWord($Event_Minigame::onMinigameActivateList,%i);
               if(isObject(%brick))
               {
                  if(getMinigameFromObject(getBrickGroupFromObject(%brick)) == %mini)
                  {
                     if(%mini.useAllPlayersBricks || (!%mini.useAllPlayersBricks && getBrickGroupFromObject(%brick) == getBrickGroupFromObject(%client)))
                     {
                        $inputTarget_Self = %brick;
                        $inputTarget_TargetPlayer = %col;
                        $inputTarget_TargetClient = %col.client;
                        $inputTarget_SourcePlayer = %obj;
                        $inputTarget_SourceClient = %obj.client;
                        $inputTarget_Minigame = %mini;
                        %brick.processInputEvent("onMinigameActivate",%obj.client);
                     }
                  }
               }
            }
         }
      }
   }
   function serverCmdAddEvent(%client,%delay,%input,%target,%a,%b,%output,%para1,%para2,%para3,%para4)
   {
      if(%input == $Event_Minigame::onMinigameActivateList)
         $Event_Minigame::onMinigameActivateList = addItemToList($Event_Minigame::onMinigameActivateList,%client.wrenchBrick);
      return Parent::serverCmdAddEvent(%client,%delay,%input,%target,%a,%b,%output,%para1,%para2,%para3,%para4);
   }
   function serverCmdClearEvents(%client)
   {
      if(hasItemOnList($Event_Minigame::onMinigameActivateList,%client.wrenchBrick))
         $Event_Minigame::onMinigameActivateList = removeItemFromList($Event_Minigame::onMinigameActivateList,%client.wrenchBrick);
      Parent::serverCmdClearEvents(%client);
   }
   function fxDtsBrick::onDeath(%brick)
   {
      if(hasItemOnList($Event_Minigame::onMinigameActivateList,%brick))
         $Event_Minigame::onMinigameActivateList = removeItemFromList($Event_Minigame::onMinigameActivateList,%brick);
      Parent::onDeath(%brick);
   }
};
activatePackage(Event_MinigameActivate);
function addItemToList(%string,%item)
{
   if(hasItemOnList(%string,%item))
      return %string;

   if(%string $= "")
      return %item;
   else
      return %string SPC %item;
}
function hasItemOnList(%string,%item)
{
   for(%i=0;%i<getWordCount(%string);%i++)
   {
      if(getWord(%string,%i) $= %item)
         return 1;
   }
   return 0;
}
function removeItemFromList(%string,%item)
{
   if(!hasItemOnList(%string,%item))
      return %string;

   for(%i=0;%i<getWordCount(%string);%i++)
   {
      if(getWord(%string,%i) $= %item)
      {
         if(%i $= 0)
            return getWords(%string,1,getWordCount(%string));
         else if(%i $= getWordCount(%string)-1)
            return getWords(%string,0,%i-1);
         else
            return getWords(%string,0,%i-1) SPC getWords(%string,%i+1,getWordCount(%string));
      }
   }
}

untested... good luck..
« Last Edit: October 27, 2013, 11:30:39 PM by MARBLE MAN »

Type: Output
Name: Brick > TransposeBrick
Description: Moves a brick a certain number of studs according to XYZ output paramaters, Z is in plates height.

ex. OnActivate > Self > Brick > TransposeBrick > 0, 0, 15
would move the brick the events belonged to five whole 1x1 bricks upwards.


i have no clue how add-on making works, but i figure this is possible? i don't see it made anywhere else.

1.1 exists as "Prompt events" or something
It does, but the point is that it does not give enough space for writing.  I would like to have enough space for paragraphs.  I've never dealt with GUIs, but I'm pretty sure this should be easy.