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 - Bauklotz

Pages: [1] 2 3 4 5 6
1
Modification Help / Script_ClientKills
« on: March 19, 2011, 03:10:38 PM »
Is there some way that I can optimize this? I have a feeling there's something exremely simple right in front of me and I'm missing it.

Code: [Select]
// ==============================
// Support_ClientKills.cs (client-sided)
// ==============================
// Author: Flaw (BL_ID: 2107)
// Project: Scripting Utilities
// ==============================
// Evaluates a callback every time a kill message is sent to us.
// ==============================

if($isLoaded["Support_ClientKills"])
   return;

package clientKills {
   function clientCmdServerMessage(%callback, %msg, %a, %b, %c, %d, %e, %f, %g, %h, %i, %j, %k, %l, %m, %n) {
      parent::clientCmdServerMessage(%callback, %msg, %a, %b, %c, %d, %e, %f, %g, %h, %i, %j, %k, %l, %m, %n);
      if(isMurderMessage(%msg, 8))
         onMurderMessage(%a, trim(strReplace(strReplace(%msg, "%2", ""), "%1", "")), %b);
      else if(isSelf DeleteMessage(%msg, 8))
         onSelf DeleteMessage(trim(strReplace(%msg, "%2", "")), %b);
   }
};
activatePackage(clientKills);

function isMurderMessage(%message, %bitmapTolerance) {
   return (strPos(%message, "%1") > -1 && strPos(%message, "<bitmap:") > 2 && strPos(%message, ">") > 11 + %bitmapTolerance && strPos(%message, "%2") > 12 + %bitmapTolerance);
}
function isSelf DeleteMessage(%message, %bitmapTolerance) {
   return (strPos(%message, "<bitmap:") > -1 && strPos(%message, ">") > 8 + %bitmapTolerance && strPos(%message, "%2") > 9 + %bitmapTolerance);
}

function onMurderMessage(%killer, %type, %victim) {
}
function onSelf DeleteMessage(%type, %victim) {
}

$isLoaded["Support_ClientKills"] = true;

2
General Discussion / Torque Markup Language Tag Listing (<> tags)
« on: March 18, 2011, 03:44:29 PM »
Wrote this in a text editor, felt like posting it.

Quote
<font:fontName:fontSize> - sets the font and fontsize as indicated. Example: <font:arial bold:20>
<tag:???> - not sure what this does
<color:rrggbb(aa)> - sets text color in hex format. Example: <color:ff0000> will display red text
<bitmap:filePath> - displays a bitmap image indicated by the file path. Example: <bitmap:base/client/ui/demoBanner>
<spush> - saves the current text formatting so that temporary changes to formatting can be made. Used with spop.
<spop> - restores the previously saved text formatting. Used with spush.
<sbreak> - not sure what this does
<just:left> - left justify
<just:right> - right justify
<just:center> - center justify
<a:ExternalURL>LinkTitle</a> - inserts a hyperlink into the text which will open the user's browser.
The external URL does not need the "http://" format. Example: <a:blockland.us>Blockland</a>
<lmargin: ##> - sets the left margin identation
<lmargin%: ##> - sets the left margin identation by % of the screen
<rmargin: ##> - sets the right margin identation
<rmargin%: ##> - sets the right margin identation by % of the screen
<clip:pixels> - cuts off text when it fills more than (pixels) pixels
<div:??> - makes a grey background for the text
<tab:##(,##,etc)> - sets the tab stops (multiple tabs are separated by commas)
<br> - Breaks the current line and begins a new one.

3
Creativity / Crappy Python Vector class.
« on: March 10, 2011, 06:24:47 AM »
Code: [Select]
from math import sqrt
class Vector(object):
    """
        Python Vector class
        Example Usage:
        ==> import vector
        ==> vec = vector.Vector([100, 200, 300])
        ==> print vec.scale(2)
        [200, 400, 600]

    """
    def __init__(self, vector):
        self.vector = vector
    def vector(self, vector=None):
        if type(vector) is NoneType:
            return self.vector
        else:
            self.vector = vector
    def scale(self, x):
        return [self.vector[0] * x, self.vector[1] * x, self.vector[2] * x]
    def div(self, vector):
        return [self.vector[0] / vector[0], self.vector[1] / vector[1], self.vector[2] / vector[2]]
    def add(self, vector):
        return [self.vector[0] + vector[0], self.vector[1] + vector[1], self.vector[2] + vector[2]]
    def sub(self, vector):
        return [self.vector[0] - vector[0], self.vector[1] - vector[1], self.vector[2] - vector[2]]
    def dot(self, vector):
        return self.vector[0](vector[0]) + self.vector[1](vector[1]) + self.vector[2](vector[2])
    def len(self):
        return sqrt((self.vector[0] * self.vector[0]) + (self.vector[1] * self.vector[1]) + (self.vector[2] * self.vector[2]))
    def dist(self, vector):
        dist = [self.vector[0] - vector[0], self.vector[1] - vector[1], self.vector[2] - vector[2]]
        return sqrt((dist[0] * dist[0]) + (dist[1] * dist[1]) + (dist[2] * dist[2]))
    def normalize(self):
        len = self.len()
        return [self.vector[0] / len, self.vector[1] / len, self.vector[2] / len]

The Vector.dist(vector) method probably produces invalid results. Just quickly made it because I was bored :/

4
Suggestions & Requests / [Engine Change] Non-Model Rendering
« on: March 05, 2011, 09:09:59 AM »
I am requesting a feature to allow us to render basic 3D shapes without models.

Solution 1: Allow us to directly create objects being rendered on the client without data-blocks (hardest, would probably need a large modification).

A few examples (not including circle, polygon, etc):
Code: [Select]
%obj = new line3D() {
    position = "0 0 0";
    target = "353 213 74";
    size = 2;
    color = "1 1 0 1";
};
That would create a yellow line from 0 0 0 to 353 213 74 with thickness 2 torque units.

Code: [Select]
%obj = new rectangle3D() {
    position = "0 0 10";
    extent = "3 3 3";
    collision = "0 0 0";
    texture = (decalData here);
};
That would create a square at 0 0 0 with a size of 3 3 3, a collision box of 0 0 0 and having the texture (decalData here) rendered on it.

Solution 2: Same as Solution 1, but using datablocks for properties like extent, collision, texture, color, size, etc.

5
Code: [Select]
function clContainerRadius(%pos, %rad, %cl) {
$radiusPos = %pos;
$radiusRad = %rad;
$radiusCl = %cl;
$radiusID = 0;
}
function clContainerNext() {
%obj = -1;
while((!isObject(%obj = serverconnection.getobject($radiusID)) || %obj.getclassname() !$= $radiusCl || vectorSub($radiusPos, %obj.getPosition()) > $radiusRad) && $radiusID < serverConnection.getCount()-1)
                $radiusID++;
return %obj;
}
What the hell is the error? I just get a infinite loop when using this.

6
Off Topic / gee flaw what
« on: March 03, 2011, 12:05:20 AM »
why did i do this.
http://www.youtube.com/watch?v=9luzFDWbcGY
also view in 240p or 720p.

7
Off Topic / WHAT TO DO
« on: February 28, 2011, 12:17:44 PM »
oh my god I am so bored, this is terrible.
what do you do when you are bored.
[/op]

8
Off Topic / launchpad is dumb.
« on: February 27, 2011, 05:46:11 AM »
what

9
Modification Help / Item Icon not working
« on: February 14, 2011, 08:19:35 AM »
I have a item with the following variable:
iconName = "./icon.png";

And in the same directory as the script containing the item, I have a icon.png (which is attached).
But when I pickup my item, the icon doesn't appear, and it's just a plain normal one with a "L" on it (item uiName starts with a L).

10
Off Topic / uh, what
« on: February 14, 2011, 07:22:15 AM »

11
Modification Help / audioProfile not working.
« on: February 09, 2011, 09:41:09 AM »
Code: [Select]
for($f = findFirstFile("Add-Ons/Script_HEVSound/fvox/*.wav") ; $f !$= "" ; $f = findNextFile("Add-Ons/Script_HEVSound/fvox/*.wav")) {
   if(isObject(nameToID($n = "hevAudio_" @ strReplace(fileBase($f), " ", "_"))))
      continue;
   $a = new audioProfile() {
      filename = $f;
      description = audioClosest3D;
      preload = true;
   };
   $a.setName($n);
}

This code runs, and it creates the object "hevAudio_deactivated", but if I do serverPlay2D(hevAudio_deactivated); - I don't hear it at all. If I run the same function with Synth_00_Sound, I hear it. But they have the same description and classname, but still don't work. What's wrong?

12
General Discussion / Image of ??? 2
« on: February 05, 2011, 05:58:55 AM »

13
Add-Ons / Ranged Tools v1.1 (by Flaw)
« on: February 03, 2011, 04:13:19 AM »
Ranged Tools (v1.1)
(by Flaw)

Description
Adds four new items:
  • Range Hammer
  • Range Wrench
  • Range Printer
  • Range Wand

Basically the same as the originals, except for that they have a increased range (200x bricks), and they have a new fancy color. Enjoy! This does not overwrite the original tools.

Also, you can type /rg hammer, /rg wrench, /rg printer and /rg wand to quickly use the items!

Test Report
This add-on has been tested on a default Blockland installation with default add-ons, and worked flawlessly without any errors.

Screenshots


Downloads
This add-on can be downloaded by clicking this link.

Installation
Place Tool_RangeTools.zip in your Add-Ons folder, restart Blockland and enable it in the Add-Ons GUI when starting a server.

14
Modification Help / Model Test Utility
« on: January 29, 2011, 11:19:18 PM »
A quick utility I created for one of my friend modellers. Allows you to preview any .dts file in the Blockland directory without scripting it or starting a server, and lets you move the 3D view, hide/show nodes, change node colors, and change ambient lightning.

Might add more features later.
Currently, there is a keybind to open it, or you could just type modelTest(); in console.

"Load" button loads the model specified in the Model input field.
"Hide" and "Show" buttons hide or show the nodes specified in the Node input field.
"Paint" button paints the node specified in the Node input field to the RGBA (divided by 255) color specified in the Color input field.
"Set" button sets the ambient color to the specified in the Ambient input field.

Script_ModelTest.zip (download host: localhostr.com)

15
Suggestions & Requests / MODEL REQUEST: Cube.
« on: January 29, 2011, 10:22:44 AM »
This is a model request of a 'cube' (box). (yes, i know this is so easy but I can't model if my life depended on it).

Size: 1x1 brick.

Pages: [1] 2 3 4 5 6