Staredit Network > Forums > Staredit Network > Topic: Trigger BBCode
Trigger BBCode
Aug 18 2010, 7:53 pm
By: shmeeps
Pages: 1 2 34 >
 

Aug 18 2010, 7:53 pm shmeeps Post #1



This is an idea I got from the Help Forums, who have a similar BBCode, except that it is for Warcraft 3.

Basically what happens is that you highlight an entire trigger, right-click it, and hit Copy to Text, and then surround it in [SC2TRIGGER][/SC2TRIGGER] tags, and it will render as if it was really in the trigger editor (or at least similar). This way, we wouldn't have to deal with that god-awful code tag, or spend 30 minutes to format a post to make it look legible.

Since I've been an on-and-off member of SEN for the past 5 years or so, and haven't really contributed too much back from what I've gained, I've taken the liberty of coding up a rough draft over the past two days or so, which you can view here: http://vgshorts.com/BBCode/BBCode3.php (Be friendly, my webserver is oh so gentle :P). All you need to do is copy an entire trigger, paste it in the box, and hit submit, and view the results. It also supports small segments, as long as they are preceded by the Events, Local Variables, Conditions, or Actions tags.

I think this would be a great addition, and would really help all of our SC2 mappers, and those who help them. It's essentially like the existing SC1 trigger tag, just for SC2.

So, if you have a few minutes, please take a couple of your triggers and run them through, and post if there is anything that gets messed up, or doesn't render properly. It would help me out alot to get this finalized, since I don't have a whole lot of triggers ready at my disposal. If you find anything wrong, please post here.

Also, if you like the idea (assuming you read this far, you might?), pass it on, see if we can get this implemented at some point in time. It's an incredibly simple script, and could probably be optimized further for use on the boards.

Known Limitations
Many lines connecting groups do not connect properly, working on an algorithm to fix that one.
I haven't not yet added support for custom scripts or custom functions. But I'll add them in over the next few days.

I'm posting this now, instead of when it was finished, to see if there is enough support for it for me to continue on with it.

Post has been edited 2 time(s), last time on Aug 27 2010, 6:17 am by shmeeps.



None.

Aug 18 2010, 8:05 pm Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Very good suggestion.

I would like to see your program supporting multiple languages (after it works flawless) because my triggers will be in German language. So I couldn't use that feature now. :(




Aug 18 2010, 10:02 pm shmeeps Post #3



Yeah, it runs only off of the English language right now. It basically just takes everything before the dash and reads the category from that. i don't think that would be very hard to implement though, as long as I had the correction translations.



None.

Aug 18 2010, 10:07 pm DevliN Post #4

OVERWATCH STATUS GO

We have an existing SC1 Trigger code, so I don't see why it would be that difficult to do one for SC2.



\:devlin\: Currently Working On: \:devlin\:
My Overwatch addiction.

Aug 18 2010, 10:18 pm shmeeps Post #5



Yeah, that's what I was thinking, and it should be a lot easier to assist people when they can actually see what they need to do, with indentation and all that. In that form they are also alot smaller than with code tags, so they don't have weird breakage, or anything like that, and you don't have to mess with taking screenshots to show it.

I coded it in PHP, which I believe most of SEN is coded in. Right now it does actually support the [SC2TRIGGER][/SC2TRIGGER] tags, but it's behind the scenes. They are added into the string though. It's also pretty well commented, so I or someone else could port it to another language as well.



None.

Aug 20 2010, 2:44 am DavidJCobb Post #6



Being able to view trigs posted by others would be useful. I'm interested in seeing what client-side code this thing outputs. It is, however, a good idea. Being able to copypasta SCII triggers would be much easier than having to type out everything individually (as we presently do for SCI triggers, which cannot be copied and pasted). :)



None.

Aug 20 2010, 3:47 am shmeeps Post #7



Quote from DavidJCobb
I'm interested in seeing what client-side code this thing outputs.
What do you mean by this, the actual code?

Also, updated version, looks nicer now, collapsible categories (which are a bit bugged >.<), still working on it though.



None.

Aug 20 2010, 4:30 am DavidJCobb Post #8



What HTML does your BBCode generate? I'd love to be able to see the end result of your script so I can pick it apart in Firebug, see what can be optimized, etc., on the client-side.

Code
[quote]Balls.[/quote]


Code
<fieldset class="quote" style="">
  <legend class="quote">Quote</legend>
  <div class="quote">Balls</div>
</fieldset>




None.

Aug 20 2010, 4:44 am shmeeps Post #9



If you input a trigger and view source, it's usually from line 22 until the last <div>.

Here's an example:

Code
<div class="trigger"><img src="Images/Format-Trigger-Name.png" alt=" " /> End Difficulty Diag<br />
<div id="0" class="section"></div><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('1')" /><img src="Images/Events.png" alt=" " /> Events<br />
<div id="1" class="section"><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Timer.png" alt=" " /> Timer - DifficultyDialogTimer expires<br />
</div><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('3')" /><img src="Images/Variables.png" alt=" " /> Local Variables<br />
<div id="3" class="section"><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variables.png" alt=" " /> GreatestPos = 0 <Integer><br />

<img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Variables.png" alt=" " /> GreatestInt = 0 <Integer><br />
</div><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('6')" /><img src="Images/Conditions.png" alt=" " /> Conditions<br />
<div id="6" class="section"></div><img src="Images/Format-Minus-End.png" alt=" " onClick="toggleCollapse('7')" /><img src="Images/Actions.png" alt=" " /> Actions<br />
<div id="7" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Dialog.png" alt=" " /> Dialog - Destroy DifficultyDialog<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Timer.png" alt=" " /> Timer - Destroy DifficultyDialogTimerWindow<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestInt = GameDifficultyVote[0]<br />

<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestPos = 0<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('12')" /><img src="Images/General.png" alt=" " /> General - If (Conditions) then do (Actions) else do (Actions)<br />
<div id="12" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('13')" /><img src="Images/Conditions.png" alt=" " /> If<br />
<div id="13" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Logic.png" alt=" " /> GreatestInt < GameDifficultyVote[1]<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('15')" /><img src="Images/Actions.png" alt=" " /> Then<br />

<div id="15" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestInt = GameDifficultyVote[1]<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestPos = 1<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Actions.png" alt=" " /> Else<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('19')" /><img src="Images/General.png" alt=" " /> General - If (Conditions) then do (Actions) else do (Actions)<br />
<div id="19" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('20')" /><img src="Images/Conditions.png" alt=" " /> If<br />
<div id="20" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Logic.png" alt=" " /> GreatestInt < GameDifficultyVote[2]<br />

</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('22')" /><img src="Images/Actions.png" alt=" " /> Then<br />
<div id="22" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestInt = GameDifficultyVote[2]<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestPos = 2<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Actions.png" alt=" " /> Else<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('26')" /><img src="Images/General.png" alt=" " /> General - If (Conditions) then do (Actions) else do (Actions)<br />
<div id="26" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('27')" /><img src="Images/Conditions.png" alt=" " /> If<br />

<div id="27" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Logic.png" alt=" " /> GreatestInt < GameDifficultyVote[3]<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('29')" /><img src="Images/Actions.png" alt=" " /> Then<br />
<div id="29" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestInt = GameDifficultyVote[3]<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GreatestPos = 3<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Actions.png" alt=" " /> Else<br />

</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('33')" /><img src="Images/General.png" alt=" " /> General - Switch (Actions) depending on GreatestPos<br />
<div id="33" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('34')" /><img src="Images/Actions.png" alt=" " /> Cases<br />
<div id="34" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('35')" /><img src="Images/General.png" alt=" " /> General - If (0)<br />
<div id="35" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('36')" /><img src="Images/Actions.png" alt=" " /> Actions<br />
<div id="36" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set Difficulty = 15<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/UI.png" alt=" " /> UI - Display "Game difficulty set to easy!" for (All players) to Error area<br />

</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('39')" /><img src="Images/General.png" alt=" " /> General - If (1)<br />
<div id="39" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('40')" /><img src="Images/Actions.png" alt=" " /> Actions<br />
<div id="40" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set Difficulty = 25<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/UI.png" alt=" " /> UI - Display "Game difficulty set to medium!" for (All players) to Error area<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('43')" /><img src="Images/General.png" alt=" " /> General - If (2)<br />
<div id="43" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('44')" /><img src="Images/Actions.png" alt=" " /> Actions<br />

<div id="44" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GameLength = 40<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/UI.png" alt=" " /> UI - Display "Game difficulty set to hard." for (All players) to Error area<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('47')" /><img src="Images/General.png" alt=" " /> General - If (3)<br />
<div id="47" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('48')" /><img src="Images/Actions.png" alt=" " /> Actions<br />
<div id="48" class="section"><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Variable.png" alt=" " /> Variable - Set GameLength = 60<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/UI.png" alt=" " /> UI - Display "Game difficulty set to impossible....." for (All players) to Error area<br />

</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Straight.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Actions.png" alt=" " /> Default<br />
</div><img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Trigger.png" alt=" " /> Trigger - Turn Start Difficulty Diag Off<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Trigger.png" alt=" " /> Trigger - Turn Handle Difficulty Diag Off<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " /><img src="Images/Trigger.png" alt=" " /> Trigger - Run Start Length Diag  (Check Conditions, Don't Wait until it finishes)<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle.png" alt=" " /><img src="Images/Trigger.png" alt=" " /> Trigger - Turn (Current trigger) Off<br />
</div></div></div


Edit: Holy wall of text Batman!



None.

Aug 20 2010, 5:35 am DavidJCobb Post #10



I don't have a trigger, but let me see what I can do with just raw source code (as opposed to an interactive in-browser DOM with JS capabilities).

First, let's indent it for readability.
[codebox]<div class="trigger">
<img src="Images/Format-Trigger-Name.png" alt=" " />
End Difficulty Diag<br />
<div id="0" class="section"></div>
<img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('1')" />
<img src="Images/Events.png" alt=" " /> Events<br />
<div id="1" class="section">
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Angle.png" alt=" " />
<img src="Images/Timer.png" alt=" " /> Timer - DifficultyDialogTimer expires<br />
</div>
<img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('3')" />
<img src="Images/Variables.png" alt=" " /> Local Variables<br />
<div id="3" class="section">
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Angle-Bottom.png" alt=" " />
<img src="Images/Variables.png" alt=" " /> GreatestPos = 0 <Integer><br />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Angle.png" alt=" " />
<img src="Images/Variables.png" alt=" " /> GreatestInt = 0 <Integer><br />
</div>
<img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('6')" />
<img src="Images/Conditions.png" alt=" " /> Conditions<br />
<div id="6" class="section"></div>
<img src="Images/Format-Minus-End.png" alt=" " onClick="toggleCollapse('7')" />
<img src="Images/Actions.png" alt=" " /> Actions<br />
<div id="7" class="section">
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Angle-Bottom.png" alt=" " />
<img src="Images/Dialog.png" alt=" " /> Dialog - Destroy DifficultyDialog<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " />
<img src="Images/Timer.png" alt=" " /> Timer - Destroy DifficultyDialogTimerWindow<br />
<img src="Images/Format-Blank.png" alt=" " /><img src="Images/Format-Angle-Bottom.png" alt=" " />
<img src="Images/Variable.png" alt=" " /> Variable - Set GreatestInt = GameDifficultyVote[0]<br />
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Angle-Bottom.png" alt=" " />
<img src="Images/Variable.png" alt=" " /> Variable - Set GreatestPos = 0<br />
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('12')" />
<img src="Images/General.png" alt=" " /> General - If (Conditions) then do (Actions) else do (Actions)<br />
<div id="12" class="section">
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('13')" />
<img src="Images/Conditions.png" alt=" " /> If<br />
<div id="13" class="section">
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Angle.png" alt=" " />
<img src="Images/Logic.png" alt=" " /> GreatestInt < GameDifficultyVote[1]<br />
</div>
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Minus.png" alt=" " onClick="toggleCollapse('15')" />
<img src="Images/Actions.png" alt=" " /> Then<br />
<div id="15" class="section"><img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Angle-Bottom.png" alt=" " />
<img src="Images/Variable.png" alt=" " /> Variable - Set GreatestInt = GameDifficultyVote[1]<br />
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Angle.png" alt=" " />
<img src="Images/Variable.png" alt=" " /> Variable - Set GreatestPos = 1<br />
</div>
<img src="Images/Format-Blank.png" alt=" " />
<img src="Images/Format-Straight.png" alt=" " />
<img src="Images/Format-Angle.png" alt=" " />
I THINK YOU'VE ALL GOT THE GIST OF IT.[/code]

Yeah... you could probably get rid of about 80% of that if you used nested lists and CSS, dude. I can't really do much without an interactive DOM, though. Again, I've no SCII trigger to test with, so I don't know what it's supposed to look like, and can't get a working in-browser version to test JavaScript and stuff on.

Absolutely no way this could be implemented with the client-side code as large as it is, not unless Devourer doesn't mind massively bloating every single post this is used in. The client-side code can be cleaned up and vastly improved, but again, I need an actual test case that I can view in browser, not just HTML copypasta. D:



None.

Aug 20 2010, 6:02 am payne Post #11

:payne:

Take this trigger to test it.
Code
Init
   Events
       Game - Map initialization
   Local Variables
   Conditions
   Actions
       Environment - Set lighting to 1st state, blending over 0.0 seconds
       UI - Hide game UI for (All players)
       UI - Show Menu Bar for (All players)
       Player Group - Add player 1 to Host
       Trigger - Run Environment  (Ignore Conditions, Don't Wait until it finishes)
       General - Pick each integer from 1 to 6, and do (Actions)
           Actions
               Visibility - Change visibility for player (Picked integer) to Unexplored within (Entire map) and Do Not check cliff level
       General - Pick each integer from 2 to 6, and do (Actions)
           Actions
               Player Group - Add player (Picked integer) to Others
       UI - Display text crawl for (All players) with title "Greeting, mortals!", text "Welcome to...", and max duration 4.3 seconds (play UI_ChallengeCountdown once, and loop UI_DoorMenu_ListSelect as characters type)
       General - Wait 4.0 Game Time seconds
       Trigger - Run Host_Dialog  (Ignore Conditions, Don't Wait until it finishes)




None.

Aug 20 2010, 6:17 am DavidJCobb Post #12



TBH I'm too lazy to write up the CSS and JS right now, but here's the basic HTML I'd need, not accounting for possible edits that may be needed for the CSS or JS:
Code
<div class="sc2-trigger">
  <ul>
     <li class="has-icon icon-paper">Init
        <ul>
           <li class="events">Events
              <ul>
                 <li>Game - Map initialization</li>
              </ul>
           </li>
           <li class="local-variables">Local Variables
              <ul>
                 <li>BLARGH</li>
              </ul>
           </li>
           <li class="conditions">Local Variables
              <ul>
                 <li>BLARGH</li>
              </ul>
           </li>
           <li class="actions">Local Variables
              <ul>
                 <li>BLARGH</li>
              </ul>
           </li>
           <li class="general-loop">General - Pick each integer from 1 to 6, and do (Actions)
              <ul>
                 <li>BLARGH</li>
              </ul>
           </li>
        </ul>
     </li>
  </ul>
  <ul>
     <li>UI_DoorMenu_ListSelect as characters type)
        <ul>
           <li class="events">General - Wait 4.0 Game Time seconds</li>
           <li class="local-variables">Trigger - Run Host_Dialog (Ignore Conditions, Don't Wait until it finishes)</li>
        </ul>
     </li>
  </ul>
</div>


Remind me via PM, please, and I'll get to writing full client-side code for this; I'm kind of a forgetful bastard. :P



None.

Aug 20 2010, 6:52 am payne Post #13

:payne:

Just wondering: will we be able to use it in our Wiki? :O



None.

Aug 20 2010, 7:04 am DavidJCobb Post #14



If we stick with MediaWiki, no. I could write a template -- maybe -- but it wouldn't have the collapse JS, and it wouldn't be a "just copy and paste the trigger in" solution. (It'd be more like what we do for SC1 triggers right now: you'd have to manually break everything into the proper fields.)



None.

Aug 20 2010, 7:08 am shmeeps Post #15



It could be possible, I was thinking of coding it as a dynamic image, so that's a solution. As far as templates go, I don't know enough about them to try.



None.

Aug 20 2010, 7:11 am DavidJCobb Post #16



Dynamic images can be implemented through CSS. Basically, CSS can remove the bullets from the lists and control the indentation, and with clever application of background images, it may be possible to get the dotted lines of the treeview and the icons without using IMG elements at all. (The dotted lines would be the trickier bits.) The collapse buttons would be left out of the code; JavaScript would actually add them after the page loads (so that people with JS disabled don't see non-functional buttons).

The list-based HTML is also much more semantic, making it more easily accessible to screen readers and search engines.

I can write the client-side code if I'm reminded and then give you instructions on what variables go where and such in order for you to implement it in the PHP you've written.



None.

Aug 20 2010, 7:09 pm shmeeps Post #17



Quote from DavidJCobb
Dynamic images can be implemented through CSS. Basically, CSS can remove the bullets from the lists and control the indentation, and with clever application of background images, it may be possible to get the dotted lines of the treeview and the icons without using IMG elements at all. (The dotted lines would be the trickier bits.) The collapse buttons would be left out of the code; JavaScript would actually add them after the page loads (so that people with JS disabled don't see non-functional buttons).

The list-based HTML is also much more semantic, making it more easily accessible to screen readers and search engines.

I can write the client-side code if I'm reminded and then give you instructions on what variables go where and such in order for you to implement it in the PHP you've written.
No need, it's been /overhauled using pieces of the WC3 I posted, especially the Javascript. Still looks pretty, and works fine, and much less size:

http://vgshorts.com/BBCode/BBCode3.php



None.

Aug 20 2010, 7:12 pm payne Post #18

:payne:

Renders perfectly.
I haven't found any bug. :)


EDIT: Oh! The name of the trigger... it's as if it was included in the tree, while I believe it shouldn't be linked with the little dots. It instead should be at the left-most of his line.
Also, as it is right now, there are doted lines running from that Trigger name to the top of the cadre. :O



None.

Aug 20 2010, 7:14 pm shmeeps Post #19



Sweet. I'm going to hopefully rewrite come parts of the the CSS, just so it's not an exact copy (well, it isn't anyways, I've already had to edit it, but still).

I work most the weekend, but I'm hoping to squeeze in some time to add in support for scripts and functions as well.



None.

Aug 20 2010, 7:21 pm shmeeps Post #20



I've left the collapse menu on the left of the name incase it was decided to hide triggers by default (so people wouldn't have to scroll through them if they didn't want to see them), or so people could hide them. It can be removed though.

As for the line moving up, I linked the wrong image for that part, I can change that with no problem.



None.

Options
Pages: 1 2 34 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[05:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[05:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[03:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[12:51 am]
Oh_Man -- definitely EUD
[09:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[09:35 pm]
Vrael -- that is insane
[09:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
Please log in to shout.


Members Online: lil-Inferno, jjf28, Roy