226
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.
ForceRequiredAddOn("Support_Preferences");
doesn't work. I returns -3 ($Error:AddOn_NotFound) tells me "Support_Preferences" is not a valid add-on, despite Support_Preferences.zip being obviously in my add-ons folder.
gamemode_zombieI assume you're referring to Rotondo's Gamemode_zombie (the download for the original map is still available on that page, btw). I remember it's inception being as big a game-changer as the introduction of City RPGs.
I ran your script and it parsed perfectly. However, it will display a warning for the colors if they don't exist in the colorset. Also, I noticed that on line 21 it didn't have any delay, which will destroy the whole purpose. I've put 2000 delay on it and will update all my examples to this instead and credit you.Woops! I was trying to demonstrate how you don't need brackets, but I forgot what my own events were supposed to do lol.
Looks like you are using an Add-On that might modify the default layout so when I read it I get bogus data. If so, please tell me and I'll find a fix around it.I am using Make Events Great Again. I'll make sure to disable it if I do any more testing in the future.
I think that labels at all is dirty. It's frowned upon in all languages but where it came from. It is sometimes a necessity, though. In our case, we're not using it like others are using it, so adding labels in such a fashion might confuse people, or make it obvious to them.Yes. Labels are typically considered bad practice in C. They are really only present for historical purposes. But, as you said, our use case is different. Eventing is not C. It's more like an instruction set. So for a more apt brown townog to event, look at any assembly language. In assembly, labeling and jumping is quite common (e.g. labels in x86 Assembly). In fact, it's pretty much necessary.
Keep in mind, that when labeling is used with indexing [from:to], it's not obvious that it's to-1. By having it at the event, it might make it more apparent that we are aiming at the event, instead of the event after it.This is actually a bit of an oversight on my part. It hit me earlier what I had done wrong. It might be better to not auto-decrement the second value in an interval like I did implicitly. Rather, [from:to] should be written like [from:to-1] to avoid confusion. This would be more intuitive to programmers (who will probably be familiar with MATLAB and Python slices) and non-programmers.
# Turn light on
onStart: [x][0]onActivate->Self->setLight("Player's Light")
[x][0]onActivate->Self->setEventEnabled([offStart:offEnd], 1)
onEnd: [x][0]onActivate->Self->setEventEnabled([onStard:onEnd], 0)
# Turn light off
offStart: [][0]onActivate->Self->setLight("Player's Light")
[][0]onActivate->Self->setEventEnabled([onStard:onEnd], 1)
offEnd: [][0]onActivate->Self->setEventEnabled([offStart:offEnd], 0)
# Turn light on
lightOn {
[x][0]onActivate->Self->setLight("Player's Light")
[x][0]onActivate->Self->setEventEnabled({lightOn}, 1)
[x][0]onActivate->Self->setEventEnabled({lightOff}, 0)
}
# Turn light off
offStart {
[][0]onActivate->Self->setLight("Player's Light")
[][0]onActivate->Self->setEventEnabled({lightOff}, 1)
[][0]onActivate->Self->setEventEnabled({lightOn}, 0)
}
Albeit less flexibly, this feels more intuitive, and it looks a bit nicer to me. If we want to increase the flexibility of this method, we could allow for the inclusion of multiple blocks in a block reference, i.e. {label1, label2, label3}. And as the cherry on top, this method would probably be the easiest to code up, as it doesn't allow/encourage the use of arithmetic inside intervals/block references.Snipers vs RunnersDidn't realize this gamemode had a history. How far back does this gamemode go? This is the oldest record of it I can find (2011).
Bushido/Heedicalking TDM'sThese were the best.
Labeling was considered once while I was developing, but not something that was required. However, with your ideas I think it's entirely possible now. I've added an issue for it and will implement it while I'm redesigning the parsing algorithm. The redesign is important to solve several issues that was raised for the current design (Like: incorrect line numbering in certain cases; unable to locate certain errors).That's good to hear! Best of luck on the redesigning. Making parsers is a bitch.
Due to how the function findText works, that is not possible. However, if I can somehow use the event global variables myself, then I would find a way around to add this sort of functionality. Don't hold your breath, though, but I've already added it as an issue.Looking at the relevant code, I can see that now.
That is true. Would you mind to provide an example script? The current example is hastened just thrown together and does absolutely nothing of value and I'm not sure I can make a easy to understand event as possible.Sure. How about this?
# Makes a brick change colors on a loop when toggled
# Start color changing (start with events enabled)
[x][0]onActivate->Self->playSound("Beep_Checkout.wav")
[x][33]onActivate->Self->fireRelay
# Stop color changing (start with events disabled)
[ ][0]onActivate->Self->playSound("Beep_Denied.wav")
[ ][0]onActivate->Self->cancelEvents
# Alternate between starting and stopping color changing
[x][0]onActivate->Self->toggleEventEnabled("0 1 2 3")
# Change colors
[x][0]onRelay->Self->setColor("0.898039 0.000000 0.000000 1.000000")
[x][500]onRelay->Self->setColor("0.898039 0.898039 0.000000 1.000000")
[x][1000]onRelay->Self->setColor("0.000000 0.498039 0.247059 1.000000")
[x][1500]onRelay->Self->setColor("0.200000 0.000000 0.800000 1.000000")
# Loop color changing
onRelay->Self->fireRelay
# Stop color changing when brick is blown up
onBlownUp->Self->cancelEvents
[ ][500]onBlownUp->Player->Kill
from your example, and it gave me an error. It tells me I have an invalid amount of parameters.[ ][0] -> "" ->
[ ][0] 0 -> 0 -> 0(0, 0, 0, "onActivate", "Self", "playSound", "Beep_Checkout.wav")
[ ][0] 0 -> 0 -> 0(0, 0, 33, "onActivate", "Self", "fireRelay")
[ ][0] 0 -> 0 -> 0(0, 1, 0, "onActivate", "Self", "playSound", "Beep_Denied.wav")
[ ][0] 0 -> 0 -> 0(0, 1, 0, "onActivate", "Self", "cancelEvents")
[ ][0] 0 -> 0 -> 0(0, 1, 0, "onActivate", "Self", "toggleEventEnabled", "0 1 2 3")
[ ][0] 0 -> 0 -> 0(0, 1, 0, "onRelay", "Self", "setColor", "0.898039 0.000000 0.000000 1.000000")
[ ][0] 0 -> 0 -> 0(0, 1, 500, "onRelay", "Self", "setColor", "0.898039 0.898039 0.000000 1.000000")
[ ][0] 0 -> 0 -> 0(0, 1, 1000, "onRelay", "Self", "setColor", "0.000000 0.498039 0.247059 1.000000")
[ ][0] 0 -> 0 -> 0(0, 1, 1500, "onRelay", "Self", "setColor", "0.200000 0.000000 0.800000 1.000000")
[ ][0] 0 -> 0 -> 0(0, 1, 2000, "onRelay", "Self", "fireRelay")
[ ][0] 0 -> 0 -> 0(0, 1, 0, "onBlownUp", "Self", "cancelEvents")
which can not be pasted into another brick.I just thought about an another way to add labels, by using existing syntax.While this would be simpler to parse, it's a bit clunkier, as per the disadvantages you listed. It's probably a bad idea to have labels attached to events. Granted, your label could always be listed like thisCode: [Select]# Turn light on
[on1][x][0]onActivate->Self->setLight("Player's Light")
[on1][x][0]onActivate->Self->setEventEnabled([offStart:], 1)
[on1][x][0]onActivate->Self->setEventEnabled([on1, on2, on3], 0)
# Turn light off
[offStart][][0]onActivate->Self->setLight("Player's Light")
[][0]onActivate->Self->setEventEnabled([on1, on2, on3], 1)
[][0]onActivate->Self->setEventEnabled([offStart:], 0)
As long as names within the square brackets doesn't contain only one x or only numbers(Nothing bad, as labels starting with numbers are not supported anyway), then it's considered a label. As before, this can be placed anywhere before the input name. This solution will allow the following:
- Labels are connected to the event, not confused to line, hence easier to read (Subjective)
- Opts to the current semantic of optional starting arguments (Might be confusing to some)
Of course, it has it disadvantages:
- Moving around events with labels might be more troublesome (Solved by placing it on its own line, wont break with semantic)
- Loss of labels named x (Who even want that?)
This is just a possibility. I still might end up using C-like labeling like Platypi suggested.
# Turn light on
[on1]
[x][0]onActivate->Self->setLight("Player's Light")
[on1]
[x][0]onActivate->Self->setEventEnabled([offStart:], 1)
[on1]
[x][0]onActivate->Self->setEventEnabled([on1, on2, on3], 0)
# Turn light off
[offStart]
[][0]onActivate->Self->setLight("Player's Light")
[][0]onActivate->Self->setEventEnabled([on1, on2, on3], 1)
[][0]onActivate->Self->setEventEnabled([offStart:], 0)
which would solve that problem. However, it doesn't change the weird naming problem. To fix that, you could simply pre-parse the square brackets at the beginning of an event listing, and allow the first to be named anything if 3 sets of square brackets are present instead of 2. It still feels a tad dirty from a coding perspective, though.
registerPref("Test", "General", "Test", "number", "$Pref::Test::Test", "Support_Preferences", 50, "1 100 0", "updateServerSetting", 0, 0, 0);
I ran it, but it didn't work. I opened the Preferences tab in the Blockland Glass Server Settings. But nothing showed up. I triedecho($Pref::Test::Test);
But it displayed nothing. However, when I runecho(TestPrefs.getObject(0).variable);
it outputs $Pref::Test::Test. I did not get an error message when I ran registerPref, so I'm not sure what I did incorrectly.
Thorfin25
I still miss my friend. I think many people do..
https://forum.blockland.us/index.php?topic=278417.0
https://forum.blockland.us/index.php?action=profile;u=30543
Sorry if I forgot your name or doubled it, it happens, let me know and I'll correct it.IGN: SadBlobfish
# Turn light on
[x][0]onActivate->Self->setLight("Player's Light")
[x][0]onActivate->Self->setEventEnabled("0 1 2", 0)
[x][0]onActivate->Self->setEventEnabled("3 4 5", 1)
# Turn light off
[][0]onActivate->Self->setLight("NONE")
[][0]onActivate->Self->setEventEnabled("3 4 5", 0)
[][0]onActivate->Self->setEventEnabled("0 1 2", 1)
With labels, it could instead be rewritten as# Turn light on
onStart:
[x][0]onActivate->Self->setLight("Player's Light")
[x][0]onActivate->Self->setEventEnabled([offStart:offEnd], 1)
[x][0]onActivate->Self->setEventEnabled([onStart:onEnd], 0)
onEnd:
# Turn light off
offStart:
[][0]onActivate->Self->setLight("Player's Light")
[][0]onActivate->Self->setEventEnabled([onStart:onEnd], 1)
[][0]onActivate->Self->setEventEnabled([offStart:offEnd], 0)
offEnd:
Or# Turn light on
onStart:
[x][0]onActivate->Self->setLight("Player's Light")
[x][0]onActivate->Self->setEventEnabled([offStart:offStart+2], 1)
[x][0]onActivate->Self->setEventEnabled([onStart:onStart+2], 0)
# Turn light off
offStart:
[][0]onActivate->Self->setLight("Player's Light")
[][0]onActivate->Self->setEventEnabled([onStart:onStart+2], 1)
[][0]onActivate->Self->setEventEnabled([offStart:offStart+2], 0)
Also# Turn light on
on1:
[x][0]onActivate->Self->setLight("Player's Light")
on2:
[x][0]onActivate->Self->setEventEnabled([offStart:], 1)
on3:
[x][0]onActivate->Self->setEventEnabled([on1, on2, on3], 0)
# Turn light off
offStart:
[][0]onActivate->Self->setLight("Player's Light")
[][0]onActivate->Self->setEventEnabled([on1, on2, on3], 1)
[][0]onActivate->Self->setEventEnabled([offStart:], 0)
Rooftop Knife TDM and Rooftop bounty hunterRooftop bounty hunters was so much fun.
Idk why i have such fond memories of rooftops