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

Pages: 1 2 [3] 4 5 6 7 8 ... 12
31
Gallery / [VIDEOS] STAIRS MAN, SOCK RUSE
« on: December 19, 2013, 11:53:48 AM »
STAIRS MAN
SOCK RUSE

thanks to JAKE NAUR and PASTAWIRE for being TERRIBLE ACTORS

32
Suggestions & Requests / Larger Road Bricks
« on: December 07, 2013, 05:05:07 AM »
Our current road bricks can't even fit a single Jeep in one lane.



What I'm asking for is a pack of road bricks equivalent to the default ones, however much bigger.
Instead of 32x, probably 64x, or maybe also 48x.

Optimally, to the point of a single Jeep filling this much on a lane:



33
Help / ModTer causes runtime errors
« on: November 30, 2013, 03:23:51 PM »
Lots of them.


34
Suggestions & Requests / Taking requests
« on: November 22, 2013, 01:35:01 PM »
I will code you stuff

35
Modification Help / State-based RNG (linear-congruential)
« on: November 10, 2013, 02:28:34 PM »
A (very) simple random number generator written in plain TorqueScript which allows you to create however many private, separate-state generators as you need.

When it comes to randomness? It's random "enough" for anything you'll need to do in Blockland. Just don't use it for bank-level cryptography and you're fine.

Usage

To create a new RNG state, call createRandContext([seed]). This will return a new "generator handle" which you can pass to all the other functions to use it. The generator will, by default, use the current platform time as the initial seed unless you explicitly pass an alternative using the seed argument.

%context = createRandContext();
echo(rand(%context)); // 0.150304, for example
echo(rand(%context, 5)); // 3.11251, for example
echo(rand(%context, 100, 200)); // 138.01, for example


Get/set the seed using getRandSeed and setRandSeed. For example:

setRandSeed(%context, 64);
echo(rand(%context, -10, 10, 0)); // -6
echo(rand(%context, -10, 10, 0)); // 4
echo(rand(%context, -10, 10, 0)); // -1
echo(rand(%context, -10, 10, 0)); // 0
echo(rand(%context, -10, 10, 0)); // 6

// set the generator back to it's initial value
setRandSeed(%context, 64);

// exact same sequence
echo(rand(%context, -10, 10, 0)); // -6
echo(rand(%context, -10, 10, 0)); // 4
echo(rand(%context, -10, 10, 0)); // -1
echo(rand(%context, -10, 10, 0)); // 0
echo(rand(%context, -10, 10, 0)); // 6


Function Reference

createRandContext([seed])

Returns a numeric "generator handle" which can be passed to other functions.
If seed is omitted, it defaults to getRealTime().

Note: This does not create an object. You don't need to clean up by deleting anything.

rand(context, [min], [max], [precision])

Returns a random number generated using the given context. If given, precision will round the result before returning. Use 0 if you want integer values. This function has the following signatures:

 rand(context)
    Returns a random floating point number from 0 to 1, inclusive.
  rand(context, x)
    Returns a random floating point number from 0 to x, inclusive.
  rand(context, a, b)
    Returns a random floating point number from a to b, inclusive.
  rand(context, a, b, c)
    Returns a random integer or floating point number from a to b, inclusive, rounded to precision digits.


getRandSeed(context)

Returns the initial seed value of the given generator context.

setRandSeed(context, seed)

Sets the initial seed value of the given generator context to seed and sets its state back to it.

Source

https://gist.github.com/portify/7403514 (37 LOC)

36
Faces, Decals, Prints / Enjoying yourself?
« on: November 02, 2013, 02:07:40 PM »

37
Gallery / Soft shadow screenshots (/very/ image heavy)
« on: September 28, 2013, 12:06:39 AM »

38
Suggestions & Requests / Larger road bricks
« on: September 27, 2013, 09:08:39 AM »
Our current road bricks can't even fit a single Jeep in one lane.



What I'm asking for is a pack of road bricks equivalent to the default ones, however much bigger.
Instead of 32x, maybe 48x, or even 64x.

Optimally, to the point of a single Jeep filling this much on a lane:


39
Modification Help / [Resource] Bot Mount Threads
« on: September 27, 2013, 08:32:23 AM »
A quick, extremely simple 14-line resource script which lets you specify "mount threads" for bot vehicles as you would with normal vehicles without any weird per-vehicle hacks.

package BotMountThreads {
   function AIPlayer::mountObject(%this, %object, %slot) {
      Parent::mountObject(%this, %object, %slot);
      %thread = %this.getDataBlock().mountThread[%slot];

      if (%thread $= "") {
         %thread = "root";
      }

      %object.setActionThread(%thread);
   }
};

activatePackage("BotMountThreads");


Usage example:

datablock AIPlayer(MyBotVehicle) {
   ...

   mountThread[0] = "sit";
   mountThread[1] = "sit";
   mountThread[2] = "root";
};

40
Add-Ons / Obstructed Radius Damage
« on: September 26, 2013, 02:13:29 PM »
Obstructed Radius Damage (version 1.0.0)

Prevents radius damage and knockback from explosions when standing behind bricks.
Download Script_ObstructRadiusDamage.zip (678 bytes).

41
General Discussion / Soft shadows
« on: September 21, 2013, 01:39:09 AM »
So I've been working on modifying the shaders to add soft, blurred shadows (configurable).
I would release this, but there are several problems with doing so:

  • You cannot replace files in shaders/ from an add-on anymore.
  • If I were to release the modified GLSL file itself,
    • you'd have to replace it and re-apply your shader settings every time you start Blockland.
    • you'd have to edit the file itself and do the above to change any settings for it.

Ideas for a viable way of releasing it would be very much appreciated.
Oh well, have some screenshots.

Recent screenshots (fixed shadow acne):





Older screenshots:




42
General Discussion / My universe is augmented
« on: September 20, 2013, 08:35:57 AM »

43
Off Topic / Err.. what?
« on: September 13, 2013, 11:21:13 AM »

44
Off Topic / yes MediaFire, I want to see more captchas like these
« on: September 06, 2013, 10:06:08 AM »




this is actually brilliant

although they're kind of ruining their own marketing
"tired of captcha"? well not anymore lol

45
I wrote a quick little support script which provides a set of functions generally related to the daycycle and the sun.
daycycles.cs (106 raw LOC)



float getDayCycleTime()

Returns the current progress of the daycycle as a floating point value between 0 and 1 while properly accounting for daycycle length and offset. The start of a cycle (0) is the point where the sun sets (elevation at 0 degrees).

int getDayCycleStage(float time)

Using time as the progress of the cycle, returns the "stage" of the daycycle as an integer, which can be either 0, 1, 2 or 3. This represents each quarter of the cycle (dawn, day, dusk and night).

str getDayCycleStageName(int stage)

Returns a friendly name for the stage. 0 => dawn, 1 => day, 2 => dusk, 3 => night.

int getMSToNextDayCycleStage(float time)

Using time as the progress of the cycle, returns the precise total number of milliseconds until the next quarter of the cycle is reached as an integer.

str getDayCycleTimeString(float time[, bool mod12])

Formats the cycle progress time as a friendly string. For example, given 0.65, it returns "15:36". If mod12 is true, the time is formatted using 12 hour time - instead of "15:36", "3:36 PM" is returned.

Vector3F getSunVector()

Returns an unit vector pointing directly to the sun's current elevation and azimuth. Works both with the daycycle enabled and disabled.

bool isPointInShadow(Vector3F pos[, SimObject avoid])

Returns whether or not an object is casting a shadow on the position pos.

void syncDayCycle()

Assuming the daycycle is enabled and the daycycle length is 86400, adjusts the daycycle offset so that the in-game daycycle is synced with the host's timezone.




Yes, all functions in this are pinpoint accurate and do not crash servers like Lugnut's.

Pages: 1 2 [3] 4 5 6 7 8 ... 12