Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Headcrab Zombie

Pages: [1]
1
Add-Ons / Headcrab Zombie's Add-on Dump
« on: August 27, 2014, 10:52:40 AM »
After RTB went down, I realized "Hey, I have a few add-on threads with only RTB links, I need to update those!" but wait! They're all too old to edit! I was going to remake a thread for each, but I decided to just make a dump for all my add-ons. Some of these were made as requests. and never released outside S&R, and may have similar add-ons already made and released



Event_Tumble
First posted here, this add-on, posted about a week after the implementation of events, was the first event I made, and although making many other add-ons, the first add-on I public ally released for the retail version of Blockland.

Quote
A tumble event, requested by insane12 for Ub3r K1tten's server.
After receiving many requests to release it, I am.
It's like when you crash on the skis.



Event_SetPlayerArmor
I think this was the fist S&R request I made. I never released this outside of S&R
An output event that equips the player with varying degrees of armor: wood, bronze, iron, steel, diamond, or adamantite, giving the player a 5%, 10%, 15%, 20%, 35%, 55%, or 75% reduction in damage



Brick_ServerSpawn
Another S&R request that I never released outside that section
A serverwide spawn point brick, placeable only by admins. If you place multiple, you will spawn to a random one.
Also included an RTB pref for "overriding" player's spawn bricks. With it off, players can place their own spawn point brick, and spawn there instead of the server spawns. With it on, the server spawns will override any spawn point brick the player placed



Event_BrickText
Originally an attempted add-on by Crysist, it was taken on by me, then added to by Munk, and released on RTB by Furling
(Code viewers beware - Furling messed with the grammar and formatting of this one and I'm too lazy to fix it)
It's an output event that gives a brick a shapename (a rendered text above the object, similar to how playernames look)
The event itself has three arguments. The first is the text you want above the brick, the second is the color, and the third is the max distance the text is viewable from
Munk added a second event: BrickTextScroll, which adds another argument, scroll speed
Also adds a special VCE var, <var:brick:bricktext>



Then, the shaders update was released, and there was a lot of opportunity with the environment system



Event_WaterLevel
Quote
Seeing some possibilities for a few water-based gamemodes.
Also might make a good pair if someone makes a setWaterLevel event with Environmental Control Event's [listed below] env_waterHeight

Contains two input events, onBrickEnterWater, and onBrickExitWater, detecting when the water level rises above or below the brick you put the events on.


Event_EnvControl
Quote
Contains many output events for changing environment settings
All events require super admin to place on a brick

All events are accessed under the brick class

Contains:
env_sky - Change the skybox
env_water - Change the water texture
env_ground - Change the ground texture
env_sunational socialistmuth
env_sunElevation
env_sunDirectColor
env_sunAmbientColor
env_sunShadowColor
env_sunFlareColor
env_sunFlareSize
env_visibleDistance
env_fogDistance
env_fogColor
env_skyColor
env_waterColor
env_waterHeight [suggest pairing with previous listed add-on]
env_underWaterColor
env_waterScrollX
env_waterScrollY
env_groundColor
env_groundScrollX
env_groundScrollY
env_vignetteColor

For events that contain a drop down menu containing 'Set' and 'Increase/Decrease' :
Set, as the name implies, sets the value to what you put.
Increase/decrease increases if you put a positive number, decreases with a negative number
waterHeight also contains an option named 'AtBrick' - this causes the water to rise to directly at the brick's bottom edge. Entering a number in the box with 'AtBrick' selected will cause the water to go to that amount above or below the brick's bottom edge



Client_SaveEnvironment

Quote
As requested by Bester Bageler

This handy add-on allows you to save the environment settings along with the bricks whenever you save, and then load that environment when you load the bricks!
And it's completely client-side, so you can use it on any server you're admin on!

Screenshots:
Load menu:

Save menu:


Important Notes:
- Fixed button alignment issues with delete extension. May cause alignment issues with other add-ons that modify the save/load bricks gui, if you find any that do, please link
- Due to the admin restriction on environment settings, saving the environment does not work if you are not admin



Script_NegativeWaterHeight
As requested by Crispy_
Extends the environment water height from 0 to 100, to -100 to 100
Requires add-on on server to function
Without client mod you  could just type /envgui_setvar waterheight <height>[/tt but you might as well just download it

2
Modification Help / Add-on breaking client-side add-ons
« on: September 12, 2013, 06:10:54 PM »
A few people have reported that one of my add-ons causes other client-side add-ons to not load.
The add-on is not causing any problems for me, so I am unable to investigate the issue and possible solutions. I've looked through the code, and nothing pops out to me as potentially problem causing

client.cs
Code: [Select]
exec("./guiMods.cs");

package Env_LoadSave
{
//Called when starting load
function LoadBricks_ClickLoadButton()
{
$LoadBricksName = filterOutString(getField(LoadBricks_FileList.getValue(),0),"/");
Parent::LoadBricks_ClickLoadButton();
}

//Called when loading is finished
function handleProcessComplete(%type,%msg)
{
Parent::handleProcessComplete(%type,%msg);
if(LoadBricks_Environment.getValue()) //Load the environment after brick loading is complete
LoadBricks_LoadEnvironment();
}

//Called when the save button is clicked
function SaveBricks_Save()
{
EnvGui.onWake(); //Appears to be the easiest way to update the client with environment settings from the server. Doing it now so it has some time to update before saving.
$SaveBricksName = SaveBricks_FileName.getValue();
Parent::SaveBricks_Save();
}

//Returns when saving is finished
function SavingGui::Save()
{
Parent::Save();
if(SaveBricks_Environment.getValue())  //Save the environment after we save bricks
SaveBricks_SaveEnvironment();
}

//Support for Siba's Delete extension
function DeleteSave_Confirm()
{
%fileName=getField($DelGui.getValue(),0);
%file = "saves/" @ %fileName @ ".ble";
Parent::DeleteSave_Confirm();
if(isFile(%file))
fileDelete(%file);
}
};
ActivatePackage(Env_LoadSave);

function LoadBricks_LoadEnvironment()
{
%fileName = "saves/" @ $LoadBricksName @ ".ble";
if(!isFile(%fileName))
return;

%file = new FileObject();
%file.openForRead(%fileName);
%file.readLine(); %file.readLine(); %file.readLine(); //Read a few lines to skip paste what we don't want
while(!%file.isEof())
{
%line = %file.readLine();
%var = getField(%line,0);
%val = getField(%line,1);
commandtoserver('envGui_SetVar',%var,%val);
}
%file.close();
%file.delete();
}

function SaveBricks_SaveEnvironment()
{
//Write the .ble environment file
if($EnvGui::SkyIdx $= "") //Not having the environment settings could be caused by a few things, such as not being an admin on the server.
{
echo("Could not save environment.");
return;
}

%file = new FileObject();
%file.openForWrite("saves/" @ $SaveBricksName @ ".ble");
%file.writeLine("This is a Blockland Environment file generated by Adam487's Save/Load Bricks Extension: Environment");
%file.writeLine("You probably shouldn't modify it cause you'll screw it up.");
%file.writeLine("");
%file.writeLine("WaterIdx" TAB $EnvGui::WaterIdx);
%file.writeLine("SkyIdx" TAB $EnvGui::SkyIdx);
%file.writeLine("GroundIdx" TAB $EnvGui::GroundIdx);

%file.writeLine("DayOffset" TAB $EnvGui::DayOffset);
%file.writeLine("DayLength" TAB $EnvGui::DayLength);
%file.writeLine("DayCycleEnabled" TAB $EnvGui::DayCycleEnabled);
%file.writeLine("DayCycleIdx" TAB $EnvGui::DayCycleIdx);
%file.writeLine("Sunational socialistmuth" TAB $EnvGui::Sunational socialistmuth);
%file.writeLine("SunElevation" TAB $EnvGui::SunElevation);
%file.writeLine("DirectLightColor" TAB $EnvGui::DirectLightColor);
%file.writeLine("AmbientLightColor" TAB $EnvGui::AmbientLightColor);
%file.writeLine("ShadowColor" TAB $EnvGui::ShadowColor);
%file.writeLine("SunFlareColor" TAB $EnvGui::SunFlareColor);
%file.writeLine("SunFlareSize" TAB $EnvGui::SunFlareSize);
%file.writeLine("SunFlareTopIdx" TAB $EnvGui::SunFlareTopIdx);
%file.writeLine("SunFlareBottomIdx" TAB $EnvGui::SunFlareBottomIdx);
%file.writeLine("VisibleDistance" TAB $EnvGui::VisibleDistance);
%file.writeLine("FogDistance" TAB $EnvGui::FogDistance);
%file.writeLine("FogHeight" TAB $EnvGui::FogHeight);
%file.writeLine("FogColor" TAB $EnvGui::FogColor);
%file.writeLine("WaterColor" TAB $EnvGui::WaterColor);
%file.writeLine("WaterHeight" TAB $EnvGui::WaterHeight);
%file.writeLine("UnderWaterColor" TAB $EnvGui::UnderWaterColor);
%file.writeLine("SkyColor" TAB $EnvGui::SkyColor);
%file.writeLine("WaterScrollX" TAB $EnvGui::WaterScrollX);
%file.writeLine("WaterScrollY" TAB $EnvGui::WaterScrollY);
%file.writeLine("GroundColor" TAB $EnvGui::GroundColor);
%file.writeLine("GroundScrollX" TAB $EnvGui::GroundScrollX);
%file.writeLine("GroundScrollY" TAB $EnvGui::GroundScrollY);
%file.writeLine("VignetteMultiply" TAB $EnvGui::VignetteMultiply);
%file.writeLine("VignetteColor" TAB $EnvGui::VignetteColor);
%file.writeLine("SimpleMode" TAB $EnvGui::SimpleMode);

%file.close();
%file.delete();
}

guiMods.cs
Code: [Select]
//Modifies the load and save bricks guis to make room for and add checkboxes for loading environment

//Modify Load Bricks gui
if(!isObject(LoadBricks_Environment))
{
//Get all the objects we need to modify
%loadButton = LoadBricks_LoadButton;
%description = LoadBricks_Description;
//Some objects we need to move don't have a name, so we have to find them
%count = LoadBricks_Window.getCount();
for(%i=0;%i<%count;%i++)
{
%obj = LoadBricks_Window.getObject(%i);
if(%obj.text $= "Cancel") //Cancel Button
%cancelButton = %obj;
if(%obj.getClassName() $= "GuiSwatchCtrl" && %obj.color $= "255 255 255 192") //Description Swatch
%descriptionSwatch = %obj;
}

//Modify some elements
%loadButton.shift("0 10");
%cancelButton.shift("0 10");
%descriptionSwatch.shift("0 15");
%description.shift("0 15");

//Create a new checkbox
new GuiCheckBoxCtrl(LoadBricks_Environment)
{
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "429 276";
extent = "150 30";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
text = "Load Environment Settings";
groupNum = "-1";
buttonType = "ToggleButton";
};
LoadBricks_Window.add(LoadBricks_Environment);
}

//Modify Save Bricks gui
if(!isObject(SaveBricks_Environment))
{
//Get all the objects we need to modify
%description = SaveBricks_Description;
//Some objects we need to move don't have a name, so we have to find them
%count = SaveBricks_Window.getCount();
for(%i=0;%i<%count;%i++)
{
%obj = SaveBricks_Window.getObject(%i);
if(%obj.text $= "Cancel") //Cancel Button
%cancelButton = %obj;
if(%obj.getClassName() $= "GuiSwatchCtrl" && %obj.color $= "255 255 255 192") //Description Swatch
%descriptionSwatch = %obj;
if(%obj.text $= "Save") //Save button
%saveButton = %obj;
if(%obj.text $= "Description : ") //Description Header
%descriptionHeader = %obj;
if(%obj.text $= "Clear") //Clear Button
%clearButton = %obj;
}

//Modify some elements
%saveButton.shift("0 7");
%cancelButton.shift("0 7");
%descriptionSwatch.shift("0 15");
%descriptionHeader.shift("0 15");
%clearButton.shift("0 15");

//Create a new checkbox
new GuiCheckBoxCtrl(SaveBricks_Environment)
{
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "14 298";
extent = "140 30";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
text = "Save Environment";
groupNum = "-1";
buttonType = "ToggleButton";
};
SaveBricks_Window.add(SaveBricks_Environment);
}

//Support for Siba's Save Delete Extension
package Env_LoadSaveGuiMod
{
function LoadBricks_Window::onWake(%this)
{
Parent::onWake(%this);
if($Env_LoadSave_SibaButtonsMoved || !isFile("Add-Ons/Client_SaveDelete/client.cs"))
return;

$Env_LoadSave_SibaButtonsMoved = 1;
LoadBricks_CancelButton.shift("0 10");
LoadBricks_DeleteButton.shift("0 10");
LoadBricks_LoadButton.shift("0 10");
}

function SaveBricks_Window::onWake(%this)
{
Parent::onWake(%this);
if($Env_LoadSave_SibaSaveButtonsMoved || !isFile("Add-Ons/Client_SaveDelete/client.cs"))
return;

$Env_LoadSave_SibaSaveButtonsMoved = 1;
SaveBricks_DeleteButton.shift("0 7");
}
};
ActivatePackage(Env_LoadSaveGuiMod);

3
Games / Steam coupons
« on: June 27, 2013, 06:31:37 PM »
Got bored and did some badge crafting and got some coupons for games I don't want and I don't want to waste them.
So if anyone wants them or preferably wants to trade for them...

I have:
-50% Dawn of Fantasy: Kingdom Wars - Expires July 4
-25% Zeno Clash 2 - July 4
-66% Sins of a Solar Empire: Trinity - July 4
-50% Victoria II - July 9
-50% Duke Nukem 3D - July 1

4
As requested by Bester Bageler

This handy add-on allows you to save the environment settings along with the bricks whenever you save, and then load that environment when you load the bricks!
And it's completely client-side, so you can use it on any server you're admin on!

Screenshots:




Important Notes:
- Fixed button alignment issues with delete extension. May cause alignment issues with other add-ons that modify the save/load bricks gui, if you find any that do, please link
- Due to the admin restriction on environment settings, saving the environment does not work if you are not admin


>>>View on RTB<<<

5
Modification Help / Security flaw in admin only events
« on: August 28, 2012, 07:20:07 AM »
For the add-on I released two weeks ago, Environmental Control Events, I included a script to allow for events that can not be placed onto a brick by non-admins. This has worked fully from release, up until recently; exactly when, I don't know, but I came onto my server this morning, and the script wasn't working, and

someone had managed to flood the server with lava, and other environmental changes.

I tried restarting the server, and it was still broken. The registerAdminOnlyOutputEvent function was being called correctly, but nothing worked; If I deadmined myself, I could still place the events, and the /restrictedEvents command doesn't show anything. The problem persists with any sort of internet server, listen or dedicated.

However, if I start a singleplayer or lan server, using the same Blockland folder and same add-on list, and deadmin myself, everything works fine; I am unable to place the event, and the /restrictedEvents command shows every event that is unavailable to me.

I have tried running on a clean install (except for this add-on of course) and the problem still occurs


Since this add-on is currently publicly available, I am rushing myself to figure out what is going wrong. If anyone else can see anything, help would be greatly appreciated

EDIT: I just realized:it was working, it was just detecting host level which is greater than super admin. Silly me.
However, the problem still remains that a non-admin was able to bypass the checks.
This thread is now about "can you find any security loopholes in the code"



6
Add-Ons / Environment Control Events - Now on RTB
« on: August 11, 2012, 08:24:36 PM »
Contains many output events for changing environment settings
All events require super admin to place on a brick, but may then be activated by anyone

All events are accessed under the brick class

Contains:
env_sky - Change the skybox
env_water - Change the water texture
env_ground - Change the ground texture
env_sunational socialistmuth
env_sunElevation
env_sunDirectColor
env_sunAmbientColor
env_sunShadowColor
env_sunFlareColor
env_sunFlareSize
env_visibleDistance
env_fogDistance
env_fogColor
env_skyColor
env_waterColor
env_waterHeight (suggest pairing with onBrickEnterWater and onBrickExitWater)
env_underWaterColor
env_waterScrollX
env_waterScrollY
env_groundColor
env_groundScrollX
env_groundScrollY
env_vignetteColor

>>>View on RTB<<<

For events that contain a drop down menu containing 'Set' and 'Increase/Decrease' :
Set, as the name implies, sets the value to what you put.
Increase/decrease increases if you put a positive number, decreases with a negative number
waterHeight also contains an option named 'AtBrick' - this causes the water to rise to directly at the brick's bottom edge. Entering a number in the box with 'AtBrick' selected will cause the water to go to that amount above or below the brick's bottom edge


EDIT: Found a pre-existing admin-only event system after I wrote my own. Oh well, I
enjoyed figuring out more about the event system to write my own, and I like how much more compact it is.

7
Seeing some possibilities for a few water-based gamemodes.
Also might make a good pair if someone makes a setWaterLevel event with Environmental Control Event's env_waterHeight

Contains two input events, onBrickEnterWater, and onBrickExitWater, detecting when the water level rises above or below the brick you put the events on.

View on RTB

8
Modification Help / Occasionally mounting to wrong slot
« on: August 10, 2012, 11:53:22 PM »
Code: [Select]
function GameConnection::spawnPlayer(%this)
{
Parent::spawnPlayer(%this);
if(isObject(%this.horse))
%this.horse.kill();
%this.horse = new Player()
{
datablock = HorseArmor;
position = %this.player.getPosition();
};
%this.horse.player = %this.player;
%this.horse.mountObject(%this.player,0);
}
This is of course in a package.

Part of something I'm making to try out the gamemode system, when the player spawns they are automatically spawned a horse and mounted to it
The problem is, sometimes the player mounts to slot 1 of the horse, instead of slot 0 (mounting at the side instead of the seat). This is literally the only place that moutObject is called, so I have no idea what could be causing it to mount to the wrong slot. This is also using the new gamemode system, so the way I understand it there are no other add-ons loaded that could be interfering with it.

EDIT: It would seem that slot 0 is the wrong slot and I should be mounting to slot 2. But this still leaves me confused as most of the time I was spawning in the slot I wanted instead of what I was telling it

9
Modification Help / Hiding Shapenames
« on: October 08, 2010, 05:24:25 PM »
Is there any way to completely hide a player's shapename? I've tried setShapeNameDistance(0) and setShapeNameDistance(-1) and both just reduce it to a very small visible distance instead of completely hiding it.

10
Games / TF2 Guest passes.
« on: August 22, 2008, 08:15:12 PM »
The free weekend starts tomorrow. If you give guest passes today, it will be wasted. So, wait until after the free weekend is over.

I also suggest one topic for TF2 guest passes.

Lastly, the first person to claim my guest pass will get it when the free weekend is over.


11
Add-Ons / Output Event - Tumble
« on: August 14, 2008, 03:05:29 PM »
A tumble event, requested by insane12 for Ub3r K1tten's server.
After receiving many requests to release it, I am.

Download

No pix to clix : It's like when you crash on the skis. Are pictures really required?


12
Games / Anyone want a Day of Defeat : Source guest pass?
« on: August 07, 2008, 03:13:53 AM »
I have a Day of Defeat : Source guest pass that will expire in 2 days if I don't send it to someone.
It let's you play the full game for a few days.

Anyone want it?

13
AoT General / Bug abuse.
« on: July 01, 2008, 10:43:59 PM »
Approximatly a year ago, I was banned for using a seemingly harmless clothes spam script. A few days ago, after an IP change, I recently started playing again, only to be harassed by Ephialtes. The harrassing isn't the bad part, it's his use of bugs and scripts to try and get my money. I logged off in wilderness, unable to resist due to a script dropping me and picking me up, between Port Town and The Woods, logged back on a few minutes later to find myself in the tunnels under The Woods. After I bit of multi-clienting, I return to see myself pulled above the tunnels.



This is not only a complaint about Ephialtes' abuse of bugs, but a general complaint about the bugs. I understand developing two games simulataneosly can be a big pain, and I am not asking for no bugs, just for the big ones to be dealt with in some way.

Pages: [1]