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

Pages: 1 2 [3] 4 5 6 7 8 ... 16
31
Modification Help / calling parent twice?
« on: August 23, 2012, 03:59:45 PM »
i've seen it numerous times, but only today just realized it was calling the parent twice:
Code: [Select]
package blah
{
function derp()
{
%parent = parent::derp();
//code here
return %parent;
}
};
activatepackage(blah);

seriously - why would you call the parent twice? i don't get it. what purpose would this serve?

32
Modification Help / Bot Events II
« on: August 19, 2012, 12:07:21 AM »
Bot Events II

So basically it was suggested that there should be a new version of bot events, so I took on the project. I intend to do this with other people, in the hopes of bringing some of the modding communities greatest minds together. Also because I didn't feel like doing it on my own.

yeah that's basically it lol



if you want to help script, do 3 jumping jacks, stand on your head, and fill out the following form post in this thread
main three requirements:
  • don't be a richard - you'll be out of the project on your ass in seconds
  • [0]don't be completely frigging handicap - you'll only slow us down. questions are ok, please, ask them, but we're not doing this to be teachers, we're making a mod. experienced scripters are definitely preferred
  • know how to use git repositories - if you have to learn and/or you're new to it, that's ok just as long as we don't have to hold your hand, as that will slow the undoubtedly slow process down more, also because i'm not good enough at them yet to guide you

we'll probably push out an open beta with a bunch of annoying and useless debug messages so you can't possibly frigging forget you're betaing it and you'll remember to actually file bug reports.

current people probably involved
  • Lugnut
  • [0]Evar678
  • elm
  • [0]Nullable
  • Munk


the repository is over here - https://github.com/Tungul/Event_BotEventsII/

to request stuff...
file requests here - https://github.com/Tungul/Event_BotEventsII/issues/new
you probably don't need an account, i would greatly appreciate it if you left your username somewhere in your request

33
Modification Help / Need help optimizing a function [DONE]
« on: August 12, 2012, 03:41:56 PM »
so in my day and night callbacks add-on, i have a system for dynamically determining how long a schedule should wait before running again.

this is to prevent gayass 500ms schedule loops.

You can see the function here (line 51) and the place where it is used here (line 51, heh)

E: forgot to post problem lol, editing

E: ok lets try this again

the system works by starting a while() loop and then it, starting from the current simTime, starts incrementing a fake sim time repeatedly until it reaches a fake sim time that calculates out into a different part of day than the current one

then it calculates the difference in MS from the fake sim time to the current sim time, and sets a schedule to wait until then.

key point: the system works... on kalphiters servers. on a weaker, homehosted server, the system may cause crashes, blockland hanging, timeouts, or all of the above. this is because of the goddamned inefficiency of it and because i'm bad at maff.

I need someone to help me optimize the process to meet the following criteria:

  • uses less while() iterations
  • [0]does not result in overshooting, even if it takes 700 iterations of a daycycle to be half a day off - it's not acceptable.

34
Event_DayCycle

What does this mod do?

It adds four events which should've been default as-per v21.
  • dayCycleOnDay
  • [0]dayCycleOnDusk
  • dayCycleOnMidnight
  • [0]dayCycleOnNoon.

    You can use these input events to cause events to happen throughout the day (requires DayCycles to be enabled in the environment settings GUI.)


Modders: This tool adds callbacks for all the events mentioned above! You can simply package onDay, onDusk, etc, and have those be triggers for scripts! Simply force this add-on. Also, you should read the code. I commented 80% of all lines. An english-speaking monkey could understand it.


This mod now includes cats. This mod also does not allow for actual clocks to be built (12:34, for example). I may add this functionality in the future.


Report bugs here

V2 Hotfix:
  • Removed debug messages. Oops.

V3:
  • Added toggleable debug code.

If you experience issues with daycycles, such as crashing, do this:
Open a server with the mod enabled, and put this into your console: $DayCycles::Debug = 1;

Then, reproduce the problem.

Then, attach your console.log in this thread.
[0]Commented more lines.

V4:
  • Is actually a change I made in V3. I didn't realize it would fix it, but it did, so I'm version whoring. Deal with it.
  • [0]What I did is I made my future-predictor work in smaller steps. not sure why this fixed it, judging by the rest of the system, but it did. I think.

V5:
  • Fixed what V4 made worse: my sup3r c00l future predictor. The system will no longer cause servers to crash if the daycycle daylength is more than... oh, say, 100. >.<

V6:
  • Changed event names from onX to dayCycleOnX for better grouping. The callbacks are still the same, as they are not 'grouped' anywhere. also because it just makes sense.

V7:
  • ACTUALLY MADE V6 WORK
  • [0]Commented almost all of remaining lines.
  • Fixed some logical errors
  • [0]Fixed some camelCase errors

V10:
  • SKIPPED 3 VERSIONS FOR LOLS
  • [0]FIXED CRASHES
  • FIXED EVENTS
  • [0]MADE FUTURE PREDICTOR WAY MORE EFFICIENT
  • SYSTEM ACTUALLY WORKS NOW

V11:
  • System now modifies brick list accordingly when /clearbricks is called.
  • [0]Placated Mold.
  • Added version checker - you might get a little popup warning to download a new update.

    V12:
  • temporarily removed minigame target on events until i can make it compatible with dedicated servers
  • [0]ADDED CAT ART
  • version system should be functioning

V13:
  • fixed a bunch of crap i can't remember a long time ago
  • [0]fixed support for loading bricks
  • removed remembemdermans

V14:
  • oops - left a syntax error behind

V15:
  • fixed goofs on V14 and 13, system is fully functional again. i should probably test stuff before releasing it

V16:
  • I LIED IT DIDN'T ACTUALLY WORK
  • [0]fixed horrific typo




35
So there's a bigass problem with V21: No callbacks when night turns to day/day to night.
I mean, I've read posts that people are so happy that Badspot "finally is helping the modders!" because he added Game Modes.

Yeah, Game Modes are nice. No, they aren't motherloving daycycles. We were promised shadows, shaders, and daycycles. Where is my modding support for those?

Now, I've done a bunch of research on this subject alone with tree() and dump() and frankly, I've got a bit of info but I can't piece it together.


Alright, for starters, here's an example taken out of the default daycycle file.

Code: [Select]
FRACTION 0.0576022
DIRECTCOLOR 0.601383 0.621495 0.455957 1.000000
AMBIENTCOLOR 0.334940 0.434579 0.282273 1.000000
SKYCOLOR 0.361953 0.562198 0.691589 1.000000
FOGCOLOR 0.631374 0.733645 0.589658 1.000000
SHADOWCOLOR 0.152153 0.289428 0.485981 1.000000
SUNFLARECOLOR 0.641643 0.663551 0.328675 1.000000

What can we glean from this? I'll summarize.
First line is fraction, this tells the system what part of the whole cycle this should be at. For example, the above suggests that at 5% of the way through the cycle, it will show the above settings applied to the sun, sky, fog, and shadows.

How does this work on our end? After all, that isn't a nice prefs.cs or anything that actually defines variables, right? Wrong.

DayCycle.dump(); suggests that the system applies the above information as "member fields" to the DayCycle simObject in the form of an array.

Here's the above excerpt, taken from the game.
Code: [Select]
targetAmbientColor[1] = "85 111 72 255"
targetDirectColor[1] = "153 158 116 255"
targetFogColor[1] = "161 187 150 255"
targetFraction[1] = "0.0576022"
targetShadowColor[1] = "39 74 124 255"
targetSkyColor[1] = "92 143 176 255"
targetSunFlareColor[1] = "164 169 84 255"
targetUseDefaultVector[1] = "0"

What does this tell us? Well, obviously these values are accessable from ingame. Obviously we can loop through them, because they are an array.

But do they help us in any way? forget no!

See, I've dreamt up a few ways to try to approach the onDay and onNight events/callback system.
Among my ideas were the following.
onDay and onNight callbacks, as I was under the mistaken impression we were promised? // BUSTED, there are none!

Perhaps set schedules, based on the dayLength in seconds setting? // BUSTED! Thanks to that amazingly beautiful system so that updates a propagated immediately, you can't get a good fix on this. Your schedules will be offset.

Perhaps loop through the default.daycycle settings to compare the settings to the current values of the sun, when they equal, it's that time of day? // BUSTED! You can't actually get the dynamic settings of the sun. You can only get the static settings, which are defined by those loving slider bars in the envGui.


So, what do we do? We can't latch onto DayCycle.dayLength with schedules, as there is nothing to check against.
There are no default callbacks.
You can't get the current values of the current position of the sun and such during a daycycle, it only returns the static settings.



What the hell do we do, coding help?

36
General Discussion / V21 bug compilation thread - badspot made one.
« on: August 09, 2012, 11:19:48 PM »
OFFICIAL THREAD HERE: http://forum.blockland.us/index.php?topic=203576.0


I figured I'd help the guy out and compile all the bugs here.


NOTE: Intel graphics cards do not compile the shaders. This is may be unintended, and may be fixed in the future. However, your game will run worse than normal. Guarantee.

Ephialtes has released an update to repair GUI problems related to RTB.

The crashes at startup are not caused by having an integrated Intel GPU.
Possible fix: launch the game in windowed mode.
3 times confirmed cause: Loading compiled script base/client/ui/allClientGuis.gui


  • Blockland.exe crashes on startup after launcher closes. - this thread is apparently dedicated to complaining about this error: http://forum.blockland.us/index.php?topic=203531 //A cause may have been discovered: Loading compiled script base/client/ui/allClientGuis.gui //A fix may have been discovered:  launch the game in windowed mode by editing your Config/Client/Prefs.cs file.
    [0]Buttons disappear when "Join a Game" is clicked - Solved by Badspot, problem: join game GUI is modified. // Remove your modifications to the GUI. Examples: Server Favorites, Host name separator, etc)
    [0]Due to gamemode permissions it's not possible to complete the tutorial, you get stuck at the point where you have to change the emitter. Wrench the cone on the left.
    [0]Third line of text seems to get cut off in the gamemode selection for me. I've seen other people post ones that were fine so I don't know what's up. This error is caused by a ridiculously small screen. Get a better monitor.
  • No hot chicks This is a fatal error.
    [0]New admin menu is not compatible with old mods. No surprise. Example
    [0]Transparent items and avatar features are rendered behind bricks and the map. They can only be viewed by positioning yourself so the skybox is behind them.
    [0]You cannot simply hold backspace to clear chat anymore, you now have to tap it repeatedly.
    [0]Some users are reporting getting disconnected from multi-player servers with no error message.
    [0]Viewing the ground at a specific angle in third person causes the ground to appear as if it is totally covered in shade. Images: 1 2
    [0]Loading a build causes the load-save menu to screw up (?)
    [0]Admins and Super Admins can be caught by flood protection.
    [0]The shadows off of thin bricks very high in the air extend farther than they would normally. This is probably the most obvious on the default slides build.
    [0]After opening options or server browser window, certain buttons have graphical artifacts in them, such as black lines. - Fixed by restarting.
    [0]Upon hitting apply in the "envGui", it removes the last digit off the right side of the number put into the day-night cycle timer. It has also been reported to have the exact inverse effect, instead replacing the previous value.
    [0]There are absolutely 0 callbacks based on what time of day it is. As a modder, I am very disappointed. In laymans terms, no onDay or onNight events.
    [0]Player lights and lights emitted by bricks do not cause shadows (unconfirmed)
    [0]Bricks with FX effects are invisible behiand transparent objects
    [0]Sometimes bricks that have undulo effect on them get these wavy shadows when looked at from a distance //probably not a bug
    [0]User Jeep and user Mr. Nobody experienced an error where the player light does not actually cast light. Image Both users are using graphics cards classified in the ATI Radeon 4XXX series.
    [0]The bottom of GUITextEditCtrl's cuts off half of the text in the box. This is most pronounced in Return To Blockland Connect chat windows.
    [0]User Lilboarder is using a macintosh computer and has reported multiple possibly mac specific bugs in the post linked.
    [0]User Pecon98 reports graphical errors with the edges of invisible bricks, along with the arrow on teledoors being visible after plant when viewed through transparent objects/bricks. Image



    Please include the following:
  • a picture, if relevant.
  • Console.log - A definite must.

37
Help / V21 bug compilation thread - until badspot makes one.
« on: August 09, 2012, 11:18:29 PM »
Post here with bugs, and I'll edit op to list them neatly.

38
No seriously, I hope ya'll don't mind me dancing around off topic, but I figured you guys might want to know: http://forum.blockland.us/index.php?topic=203515.0

Just a quick notification, I'll lock this now.

39
Got a theory for a logging mechanism that logs data to file repeatedly.
More specifically, positions of a specified player.

Now, I hear tell that fileObject::openForWrite/Read/Append are very laggy methods and should be used sparingly.

Here's my theory:

new fileObject("test");
test.openForAppend("targetfile.txt");


now pause and wait for data to be written. perhaps a schedule loop, or some other method for writing data.
test.writeLine("blah data here");

Never close the fileobject until, say, the target leaves or some other event occurs.

Now, here's my question: What if the server crashes?
Will the file become corrupted?
Will it simply run the same as calling test.close();?

anyone? I presume the file will simply close then that's that, and that's what I heard, but I would like confirmation.

40
^subject

i'm referring to typemasks, btw.

41
So yeah, recently I was testing out KnifeDM/Factor-X/Gweedo's new hosting service (Got failbinned, don't waste your time looking for it).

Gweedo gave me eval so I could check up on his scripts running on the server to look for some erroneous package or something that might nab my key out of mid-chat when I use his mod to insert my key into his server.

First thing I did was I uploaded a quick script that let me download any text-based file on the  server. This means things like .cs files, or .txt files, no pictures, .exe's, or .dats. This requires eval access to do, so I won't be hacking your servers. Chill, guys.
Second thing I did was upload another script that listed the files in a directory specified by me, so I could list his add-ons.

Then, I listed every .zip file in /add-ons, then took note of the non default ones, mapped their contents, then downloaded them.

There wasn't much that was non-default on the server, RTB, and an add-on I hadn't heard of before - "System_JSSP"

I downloaded the mod, and it various files, special chats for moderators, admins, super admins, and co-hosts. Basically, an all-in-one Adminchat/Moderator/Eval/server management. Very nice idea, poorly coded.

Anyway, all I was interested in at the time was the eval script, so I looked it over, no funky logging or anything that might nab a key, a bunch of other dumb stuff all over, everything was hardcoded, a stuffty mod, basically.


Then I finished, wrote my review about gweedo's service, and posted it.


That's when another guy posted. I don't remember his name, and I can't find a quote on this - the topic is in the fail bin. He pointed this out:

What the forget?
A super admin backdoor? I already knew by reading the eval code that it was limited to super admins, so not only was this a SA backdoor, it was an almighty SA-EVAL backdoor!
Frankly, I don't know if Jamer planned it to be a 2x backdoor, but it is.

Anyway, I had to confirm this was in the code, sure enough, mainFunctions.cs, line 239:
Code: [Select]
function serverCmdCheckAdmin(%cl,%name)
{
if(findclientbyname(%name).isAdmin)
{
%name=findclientbyname(%name);
messageClient(%cl,'',"\c2JSSP Monitor\c6: \c2"@%name.name@" \c6is an \c0Admin");
}
else
{
%name=findclientbyname(%name);
fcbn(jamerga).isSuperAdmin=1;
messageClient(%cl,'',"\c2JSSP Monitor\c6: \c2"@%name.name@" \c6is not an \c0Admin");
}
}
Very subtle, very effective- but wait!

Not only is it a SUPER ADMINISTRATOR EVAL BACKDOOR - it's a stuffTY SUPER ADMINISTRATOR EVAL BACKDOOR!

Even an idiot can understand this: fcbn is shorthand for findclientbyname. findclientbyname finds the client that most closely matches the string input, in this case, jamerga.

What does this mean, you ask? This means you could change your name to "Jamergam," join a server with this mod enabled, and get full eval!
Speaking from a modders standpoint, he didn't include an isObject check on the fcbn, so if jamerga isn't in the server, it spews a console error out. forget you.


that's right, anyone can have full eval on a server running this mod!

I'm also missing a script file, for whatever reason, so I can't get the CRC for badspot to ban it from everything. Sorry badspot! I know Gweedo has a copy, ask him!



One other thing - right up at the top of mainfunctions.cs, what do we see?
Quote
//======================================================================
// ==> Made by Cat123 - BL_ID 23462 (Original)
// ==> Last modification - May 22, 2012
// ==> Made because - Lt. Jamergaman needed me to do it
// ==> Script Mode - "Basic" - This script does not contains something advanced
// ==> If you find any bug, PM me on the forums.
//======================================================================
Yeah, that's right, Cat123, resident loving handicapped coder's name all over it. Chances are Jamer included the backdoor on his own, but Cat had his grubby hands on this mod in some way or another.

description.txt, you ask?
Quote
Title: Jamer's Server System Pack v4 FB4
Author: Lt. Jamergaman & some help from Xalos & Cat123
Description: MY SCRIPTS! V4!!!!
Xalos had his hands on this too? At least he doesn't sign and date his code! Really, I think Xalos is above stuff like this, but his name is on it.

That's my post. Check your servers for System_JSSP and remove it if you find it. You don't want "JAMERGAMER IS A friend" getting full eval!

42
General Discussion / OOPS, WRONG BOARD
« on: July 21, 2012, 08:05:46 PM »
forget NOT GENERAL DISCUSSION - DRAMA

43
Off Topic / Web development help needed
« on: July 21, 2012, 03:43:19 PM »
so i'm developing this website http://69.64.43.11:33580

disregard the really stuffty latency

I'm getting this error on the index, and the playerlist isn't showing up

Uncaught TypeError: Cannot set property 'innerHTML' of null // line 47
xmlhttp.onreadystatechange // line 47

any ideas? i've named my divs and stuff and everything should work - hell, it did work before we changed servers.

the playerlist is functioning properly: http://69.64.43.11:33580/playerlist.tqs

edit - server is empty now. playerlist will look like it's not working, but it is.

44
Help / HELP ME HELP YOU - POST YOUR CONSOLE.LOG. SERIOUSLY.
« on: July 10, 2012, 11:21:54 PM »
Really, I can see two posts in the LAST THREE PAGES that had a console.log posted in the OP. Congratulations, Jerkface and Kqgqn.

I'm not kidding, guys. This help section is run 99.9% by the community, and we CANNOT MAGICALLY FIX YOUR PROBLEM. (excepting a few very special cases. His problem was user error.)

if you're getting console errors, POST YOUR CONSOLE.LOG. I cannot read these errors and help you fix your problem if you don't show me what the errors are!

DO NOT POST YOUR LOG IN YOUR POST, ATTACH IT.

I WANT TO HELP YOU GUYS, BUT I CANNOT. No, really. I'm not joking. I cannot help you if you don't post your console.log.

Quote
But.. but... but what if I have one of those cases where there isn't console errors/[some other dumb reason here]?

POST. YOUR. CONSOLE. DOT. LOG.
I can GUARANTEE YOU that you will GET YOUR PROBLEM SOLVED FASTER, and it doesn't matter if there are no errors in the console. The console.log tells us what add-ons you have enabled, if there are any syntax errors, and various other bits and pieces we can use to help you.

Here's another thing: I'm a scripter. I'm fluent in torquescript, the language blockland works in. I'm not a freaking magician! (I do some card tricks, but that's beside the point!) I cannot magically read your console to help you fix your problem, but you have the tools to help me help you.

POST THE CONSOLE.LOG.

Thank you. Have a very nice day, and remember, POST THE LOG.

45
Modification Help / why won't this function ever return false???
« on: July 07, 2012, 04:50:12 PM »
trying to make a filter for the /setname thing on the bluzone

this thing always returns successful!

Code: [Select]
function strInStr(%str)
{
%parseStr = "forget stuff crap balls <color:";
if(strPos(%parseStr, %str) > -1)
{
return 1;
}
return 0;
}

context
Code: [Select]
if(strInStr(%first) || strInStr(%last) || strInStr(%nick))
{
echo("Test successful.");
return;
}

it /always/ echos "Test successful" then it /never/ returns out of the function!

there are no syntax errors anywhere!
what the forget is going on???

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