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.


Messages - Quartz

Pages: 1 2 [3] 4 5 6 7 8 ... 22
31
Modification Help / Re: [Resource] DateTime
« on: September 07, 2018, 04:36:49 AM »
Is this an interpretation of simtime or a virtual calendar
It's a virtual calendar, without the days of the week.

The determination of what day a specified date seems "numerically-solved" to me, which is a bit ugly to me.

32
Modification Help / [Resource] DateTime
« on: September 06, 2018, 05: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.

33
General Discussion / Re: blockland people are weird
« on: September 06, 2018, 04:44:37 AM »
guys dont say *bad word* my mom might come in and see it
blowing up mailboxes

34
Gallery / Re: Fortnite House
« on: September 06, 2018, 04:32:42 AM »
It looks weird, how the player has no applied anti-aliasing, but the edges of the house is silky smooth.

35
Suggestions & Requests / Re: Guard bot AI.
« on: September 06, 2018, 04:18:04 AM »
Make a package w. a function that checks if a player damages another player, do a container search looking for Guard bot type, if raycast from guard to attacker hits attacker, there is a direct line of sight and guard should now engage attacking player.

36
if the chainsaw was rusty it wouldn’t have cut through idiot
I doubt rust would make the experience more pleasant.

37
Tony, you should take inspiration from m.dts and have tons of nodes that you can hide/unhide, every armor piece in 1 .dts. You only have to mount that one .dts then and hide the unequipped nodes.

You could also just make a new m.dts with extra nodes. (You could do interesting anims, visor up/down, perhaps animation to visualize the damage done to the armor)

I guess you could make individual hp values for each piece of armor and have an individual piece degrade when it's hit by a projectile.

38
General Discussion / Re: someone want to make a guide for welcome messages
« on: September 03, 2018, 05:18:56 AM »
<spush> <spop> for locally saving / loading your formatting
+
Code: [Select]
virtual Script rgbToHex() {}
/*!  - converts hex string or 0-255 color values into 0.0-1.0 values */
virtual string getColorF(string color) {}
/*!  - converts hex string or 0.0-1.0 color values into 0-255 values */
virtual string getColorI(string color) {}
==>echo(rgbToHex("255 255 255")); echo(getColorF("FFFFFFAA")); echo(getColorI("FFFFFFAA"));
FFFFFF
1.000000 1.000000 1.000000 0.666667
255 255 255 170

39
Modification Help / Re: Finding Dynamic Fields on SimObject
« on: August 29, 2018, 05:13:32 PM »
Tagged fields? Sorry, it's been forever since I've worked with these.

Code: [Select]
%index = 0;
while((%field = %object.getTaggedField(%index)) !$= "")
{
//do stuff here
%index ++;
}
Thank you.

40
Modification Help / Re: Finding Dynamic Fields on SimObject
« on: August 27, 2018, 07:25:20 PM »
It could be saved and read, that's true. That's probably better, since I just realised the ConsoleLogger saves to path as well, so there's no point in using .dump() when I do not require information on methods.

41
Modification Help / Finding Dynamic Fields on SimObject
« on: August 27, 2018, 02: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?

42
General Discussion / Re: older blockland user check-in.
« on: March 24, 2018, 10:55:33 AM »
hi

43
Handegg.

44
Modification Help / Re: [BETA OUT] Scratch for Blockland
« on: February 04, 2018, 08:56:07 AM »
Support for OOP would be favored.

45
Off Topic / Re: Blocklander of the Year 2017
« on: December 11, 2017, 11:16:40 PM »
Barnabas
Barnabas
Barnabas

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