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

Pages: [1] 2 3
1
Off Topic / LEGO Island 1 - HQ Music pack
« on: January 15, 2020, 10:52:53 AM »
Hey,

For all you oldies who played LEGO Island 1.
You can get a HQ version of all the tracks here.

https://projectisland.org/music/

2
Add-Ons / Barber
« on: September 08, 2018, 06:58:03 PM »

Hey, I made a barber mod that uses Mr.Noßody's hair models. (works as a standalone, which means no integration for HatMod)
Was originally made for Rosemarble, but eh... why not just release it?

Download from Blockland Glass
Download (mirror)

3
General Discussion / Made a beginners guide on Steam
« on: September 08, 2018, 05:53:46 AM »

4
Modification Help / [Resource] DateTime
« on: September 06, 2018, 04:55:08 PM »
Calendar stuff sux, so I have something to help you a bit on your way. Sorry about not having days of the week (monday, tuesday), that stuff boggles my mind.
Also, to perfect the isLeapYear, I suppose you could make the rules dependent on when the rules were introduced in real life (for instance: Gregorian calendar)

Here's some DateTime functions:
Code: [Select]
function DateTime::getDate(%this)
{
return %this.day@"/"@%this.month@"-"@%this.year;
}

function DateTime::addTime(%this, %time, %timeFormat)
{
if(%timeFormat $= "")
%timeFormat = "s";
switch$(%timeFormat)
{
case "s" or "second":
%this.second = %this.second+%time;
%this.cleanTime(s);
case "m" or "minute":
%this.minute = %this.minute+%time;
%this.cleanTime(m);
case "h" or "hour":
%this.hour = %this.hour+%time;
%this.cleanTime(h);
case "d" or "day":
%this.day = %this.day+%time;
%this.cleanTime(d);
case "mo" or "month":
%this.month = %this.month+%time;
%this.cleanTime(mo);
case "y" or "year":
%this.year = %this.year+%time;
}
}

function DateTime::daysInMonth(%this, %month, %year)
{
if(%month $= "")
%month = %this.month;
if(%year $= "")
%year = %this.year;

if(%month < 1 || %month > 12)
return 0;
if(%month == 2)
if(%this.isLeapYear())
return 29;
else
return 28;
else if(%month == 4 || %month == 6 || %month == 9 || %month == 11)
return 30;
else
return 31;
}

function DateTime::cleanTime(%this, %unit) //Method that cleans the time, making sure there's not gonna be a 26:61 37/-5/2015
{
switch$(%unit)
{
case "s":
if(%this.second > 59)
{
%this.minute = %this.minute + mFloor(%this.second / 60);
%this.second = %this.second % 60;
return %this.cleanTime("m");
}
case "m":
if(%this.minute > 59)
{
%this.hour = %this.hour + mFloor(%this.minute / 60);
%this.minute = %this.minute % 60;
return %this.cleanTime("h");
}
if(%this.minute < 0)
{
%this.hour--;
%this.minute = 60 + %this.minute;
return %this.cleanTime("m");
}
case "h":
if(%this.hour > 23)
{
%this.day = %this.day + mFloor(%this.hour / 24);
%this.hour = %this.hour % 24;
return %this.cleanTime("d");
}
if(%this.hour < 0)
{
%this.day--;
%this.hour = 24 + %this.hour;
return %this.cleanTime("h");
}
case "d":
if(%this.day > %this.daysInMonth())
{
%daysInMonth = %this.daysInMonth();
%this.month = %this.month + mFloor(%this.day / %daysInMonth+1);
%this.day = %this.day % %daysInMonth;
return %this.cleanTime("mo");
}
if(%this.day < 1)
{
%this.month--;
%this.day = %this.getDaysInMonth() + %this.day;
return %this.cleanTime("d");
}
case "mo":
if(%this.month > 12)
{
%this.year = %this.year + mFloor(%this.month / 12);
%this.month = %this.month % 12;
}
if(%this.month < 1)
{
%this.year--;
%this.month = 12 + %this.month;
return %this.cleanTime("mo");
}
}
}

function DateTime::ToString(%this)
{

return %this.TimeToString() SPC %this.DateToString();
}

function DateTime::isLeapYear(%this, %year)
{
if(%year $= "")
%year = %this.year;


if(%year % 4 == 0)
if(%year % 100 == 0)
if(%year % 400 == 0)
return true;
else
return false;
else
return true;
else
return false;
}

function DateTime::DateToString(%this)
{
return %this.day@"-"@%this.month@"-"@%this.year;
}

function DateTime::TimeToString(%this)
{
%hour = %this.hour; %minute = %this.minute; %second = %this.second;
if(%hour<10)
%hour = "0"@%this.hour;
if(%minute<10)
%minute = "0"@%this.minute;
if(%second<10)
%second = "0"@%this.second;
return %hour@":"@%minute@":"@%second;
}


function DateTime::setTime(%this, %hour, %minute, %second)
{
if(%hour > 23 || %hour < 0 || %minute > 59 || %minute < 0 || %second > 59 || %second < 0)
return;
%this.hour = %hour;
%this.minute = %minute;
%this.second = %second;
}

function DateTime::setDate(%this, %day, %month, %year)
{
if(%day > %this.getDaysInMonth(%month, %year) || %day < 1 || %month > 12 || %month < 1)
return;
%this.day = %day;
%this.month = %month;
%this.year = %year;
}

Create a DateTime Object:
Code: [Select]
new ScriptGroup(GameTime)
{
class = DateTime;

second = 0;
minute = 0;
hour = 0;
day = 1;
month = 1;
year = 1;
};

That's all for now.

5
Modification Help / Finding Dynamic Fields on SimObject
« on: August 27, 2018, 01:11:58 PM »
Hello modders,

I'd like to retrieve all the "dynamic fields" from a SimObject, similar to how the GuiGroup -> InspectDlg -> InspectTitle -> InspectFields (class: GuiInspector) functions.
Now the functionality of the tree inspector is written in the C++ TGE source code and the functionality to retrieve fields appears exclusively accessible to the C++ interface.

The only solution I can think of is logging the console when doing a .dump() (bad-dum-ts), and then just use the data before you reach the Methods: line.

That solution seems a bit silly, it would work, but I'd like to know, if there might better solution. Has anyone encountered this problem before?

6
Games / Blocklanders @ Battle.NET
« on: October 25, 2017, 04:39:38 AM »
I made a Social Group for Blocklanders. (new Battle.NET feature)

Join the group!





Image: (Clickable)

Basically if you want to join, you'd have to set your client's region to Europe via the App's login box.

7
Modification Help / Animated textures in particles, do they work?
« on: October 02, 2017, 07:41:11 AM »
Has it actually worked for anyone before?

8
Hey,

Let's say we've got our %cam = %client.player.camera;
How do we set the rotation of the camera so it aims at our %pos?

9
Modification Help / invert
« on: November 04, 2015, 01:21:07 PM »
Code: [Select]
if(isPackage(invertedavatar))
deactivatePackage(invertedavatar);
package invertedavatar
{
function serverCmdUpdateBodyColors(%client, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
{
%a1 = 1-getWord(%a1,0) SPC 1-getWord(%a1,1) SPC 1-getWord(%a1,2);
%a2 = 1-getWord(%a2,0) SPC 1-getWord(%a2,1) SPC 1-getWord(%a2,2);
%a3 = 1-getWord(%a3,0) SPC 1-getWord(%a3,1) SPC 1-getWord(%a3,2);
%a4 = 1-getWord(%a4,0) SPC 1-getWord(%a4,1) SPC 1-getWord(%a4,2);
%a5 = 1-getWord(%a5,0) SPC 1-getWord(%a5,1) SPC 1-getWord(%a5,2);
%a6 = 1-getWord(%a6,0) SPC 1-getWord(%a6,1) SPC 1-getWord(%a6,2);
%a7 = 1-getWord(%a7,0) SPC 1-getWord(%a7,1) SPC 1-getWord(%a7,2);
%a8 = 1-getWord(%a8,0) SPC 1-getWord(%a8,1) SPC 1-getWord(%a8,2);
%a9 = 1-getWord(%a9,0) SPC 1-getWord(%a9,1) SPC 1-getWord(%a9,2);
%a10 = 1-getWord(%a10,0) SPC 1-getWord(%a10,1) SPC 1-getWord(%a10,2);
%a11 = 1-getWord(%a11,0) SPC 1-getWord(%a11,1) SPC 1-getWord(%a11,2);
%a12 = 1-getWord(%a12,0) SPC 1-getWord(%a12,1) SPC 1-getWord(%a12,2);
%a13 = 1-getWord(%a13,0) SPC 1-getWord(%a13,1) SPC 1-getWord(%a13,2);

Parent::serverCmdUpdateBodyColors(%client, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
}
};
activatePackage(invertedavatar);

10
Modification Help / Projectile item source
« on: November 03, 2015, 05:07:09 PM »
Hello,

How would I know what tool/weapon a projectile would come from, when all I know is the projectile object handler?

11
Modification Help / [INFORMATION] ScriptObjects
« on: October 23, 2015, 05:46:58 PM »
SCRIPTOBJECTS

When an object is created, it is created with an identifier and a name. The identifier is unique, but that’s not always the case with the name.
To create a new ScriptObject write this:

Code: [Select]
new ScriptObject(foo);This creates a new ScriptObject called foo. It's ID is unknown, but the prior command will return the identifier. Therefore you can do this:
Code: [Select]
$myFoo = new ScriptObject(foo);$myFoo equals to the identifier of the ScriptObject called foo. E.g: "echo($myFoo);" => "1337"
These ScriptObjects can contain both data and functions, which are called "methods and fields", when we're dealing with objects. To assign a value to a given field, you can do these commands:

Code: [Select]
foo.data = "bar";or
Code: [Select]
$myFoo.data = "bar";or
Code: [Select]
1337.data = "bar";These 3 commands will do the same thing in this context. However, if you have more than 1 object called foo, the game won't know which one you want to reference. Therefore you could assign the wrong object's field called "data" to "bar". This is why you want to make sure that the names are unique OR that you keep track of your objects' identifier.
This works with arrays too:

Code: [Select]
$myFoos[0] = new ScriptObject(foo);
$myFoos[1] = new ScriptObject(foo);
Now if you write
Code: [Select]
$myFoos[0].data = "bar";
$myFoos[1].data = "bahh";
echo($myFoos[0].data SPC  $myFoos[1].data);
It will return "bar bahh" in console. There are other ways to be sure you "talk" about the right object too. Anyway, let's move on to something very important: Classes.
With classes, you can create objects that start out with functionality that you have defined. To create an object with a class, you do either:
Code: [Select]
$myObject = new ScriptObject(foo)
{
class = myClass;
};
or
Code: [Select]
$myObject = new ScriptObject(foo);
$myObject.class = myClass;

Hooray! We've created our first class. As we mentioned earlier, an object can contain
functions. These are called methods. To create a method for the class "myClass”, you can do this:

Code: [Select]
function myClass::myMethod(%this)
{
echo("The object with the identifier” SPC %this SPC "called myMethod”);
return "yay”;
}
NOTE: When an object’s method is called, the first parameter equals to the identifier of the object. Therefore we can set data or call other methods for this object.

Now since the object we created earlier has the class "myClass”, we can run the method by writing:
Code: [Select]
$myObject.myMethod();
NOTE: Be careful to not mistake fields for methods. $myObject.myMethod() returns "yay”, but $myObject.myMethod
does nothing, since without the brackets the game will consider $myObject.myMethod as a FIELD!

When an object contains methods, it is because it has inherited it. An object can inherit methods from 3 places:
•   A class.
•   A superclass.
•   The object’s name.

To concretize this, let’s imagine we have a cat called Bill. Animals can eat things, therefore Bill can eat things. But Bill is a cat too, therefore he can purr! Bill is very special cat as well. That’s because he can do a cool trick, where he solves a Rubik’s cube. If Bill was a ScriptObject, he would look like this:

Code: [Select]
$myPet = new ScriptObject(Bill)
{
superclass = Animal;
class = Cat;
};

function Animal::eat(%this, %target)
{
//insert eat code
%this.hunger = 0;
echo(%this.getName() SPC "has eaten” SPC %target);
}

function Cat::purr(%this)
{
//insert purr code
echo(%this.getName() SPC "won’t stop purring!”);
}

function Bill::solveRubiksCube(%this, %cube)
{
//insert your simple solving code
echo(”Wow!” SPC %this.getName() SPC "actually solved" SPC %cube SPC ", a Rubik’s Cube. Does Mensa accept cats?”);
}

Now we’ve created 3 methods with 3 different namespaces. But since Bill’s class is "Cat”, his superclass "Animal” and his name is "Bill” – he can use ALL the methods within these namespaces! That’s great for Bill.
This means these three commands will work:

Code: [Select]
$myPet.eat("Tonce”);
$myPet.purr();
$myPet.solveRubiksCube( new ScriptObject(cube1) { class = RubiksCube; } );
This will output:
Code: [Select]
Bill has eaten Tonce
Bill won’t stop purring!
Wow! Bill actually solved (objectIdentifierHere), a Rubik’s Cube. Does Mensa accept cats?
ScriptObjects are very useful because, it introduces Object-oriented programming into TorqueScript.

Some helpful commands:
Code: [Select]
obj.dump(); - Dumps all methods and fields for a specified object.
tree(); - Opens a GUI where you can inspect objects in their hierarchy.

Sorry for the semi-stuffty layout. If something is off (either content or layout), please inform me.

12
Modification Help / Saving objects as *.cs or a third saving system
« on: October 12, 2015, 03:02:55 AM »
Hello,

If I were to save some object information, would it be better to script a third saving system — or can I just be lazy and use obj.save()?

What would be the benefits of each solution?

13
Modification Help / 3D MousePos Raycast
« on: October 06, 2015, 05:36:33 PM »
Hello Coding Help,

How would I cast a ray from my mouse position on the screen, so the game would know what object I'm pointing at?

Pretty much how the Mission Editor works.

14
Music / Quartz's Music
« on: February 19, 2010, 03:23:34 AM »
Quartz's Music
Hi people, I made some music for ya.
These are short looping tracks, sounding like the real Blockland loops.

Downloads
Hip Hop Bob
Groovy Fruity

15
Off Topic / Pictaps
« on: February 02, 2010, 11:58:45 AM »
This is fun. :D

This game is where you draw your own drawing and bring it to life.

Look what I made.
http://roxik.com/pictaps/?pid=a2592629 - Blockhead
http://roxik.com/pictaps/?pid=a2592635 - collonthreeman

Pages: [1] 2 3