Page 3 of 3

Re: Bships Code Error

Posted: Mon May 25, 2009 9:06 pm
by ikillforeyou
i'm not that good at understanding anything else then like lines of code, because i dont know jass very well, could you make a line of code in we then cp n' paste it? I had help fixing it, you dont need to worry. But just for future reference :D :D oh, and my map has an option for the host to pick the options himself or just let votes do it...
And just a quick question, what would this system do if there was a tie in the votes?

Re: Bships Code Error

Posted: Tue May 26, 2009 4:13 am
by 3ICE
Spell check time! I'm* than* -like* I* don't* well.* Could* -in (wtf grammar!) copy and paste* don't* (Seriously, get a spell checker...)


If there was a tie, then this would happen (Assuming you use the fixed version below):

Case study:
Arr[1]=2
Arr[2]=2
Arr[3]=2
Arr[4]=2
Arr[5]=2
Arr[6]=2
Arr[7]=2

In this tie(d) case, the fixed version would think that Arr[1]=2 is the highest, because:
If (Arr[1]=2 > Arr=0) then Set MaxValue = i=1 (MaxValue changed to i = 1)
If (Arr[2]=2 > Arr=2) then Set MaxValue = i=2 (MaxValue stays at 1)
If (Arr[3]=2 > Arr=2) then Set MaxValue = i=3 (MaxValue stays at 1)
If (Arr[4]=2 > Arr=2) then Set MaxValue = i=4 (MaxValue stays at 1)
If (Arr[5]=2 > Arr=2) then Set MaxValue = i=5 (MaxValue stays at 1)
If (Arr[6]=2 > Arr=2) then Set MaxValue = i=6 (MaxValue stays at 1)
If (Arr[7]=2 > Arr=2) then Set MaxValue = i=7 (MaxValue stays at 1)

My "MaxValue" stands for your "Highest_VotecountArray" variable. I'm still wondering what on earth VotecountArray means and why isn't C uppercase, but whatever.
My "i" stands for your "(Integer A)". GUI = bloat. :)
My "Arr" stands for your "IGametypevotecount". I'm still wondering what on earth IGametypevotecount means and why aren't T, V and C uppercase, but whatever.

The case study is just logic, you can figure out stuff like this on your own. Run through the loop and write down what the game thinks at every step.

This is exactly what debuggers do. Setting a breakpoint in your code and then going through it step by step, always seeing what each variable is and when they change and to what and by which code line.


And here is the copyable code (fix highlighted in red):
If (IGametypevotecount[(Integer A)] Greater than IGametypevotecount[Highest_VotecountArray]) then do (Set Highest_VotecountArray = (Integer A)) else do (Do nothing)
Your variable names are a bunch of nonsense to me, but if you like them that way, do not change just because I don't like them. :)

EDIT: Just to make things clear, in case of a tie, the value with the smallest index ("i" or "(Interger A)") always wins. So position the options that are "best"/"most fun" at the top, so if there is a tie the players will get the "better"/"more fun" mode.

Re: Bships Code Error

Posted: Tue May 26, 2009 11:36 am
by ikillforeyou
I made the best/most used one, idk about fun at the top. And seriously, if you want us to use spell checkers, JUST MAKE A CODE ONE FOR UR WEBSITE! (unless that is too hard) also, cant you just make the html code find what function your using and then put the little T_ thing icon infront of it? that would work alot better. :D

Re: Bships Code Error

Posted: Tue May 26, 2009 12:27 pm
by 3ICE
Okay.

Spell checking requires a dictionary of every word. I'm not going to host dictionaries on my website.

What html code? Nobody can program in html, its a markup language only.

p.s.: You should read the news and this.

Re: Bships Code Error

Posted: Tue May 26, 2009 5:29 pm
by ikillforeyou
kewl, a bit complicated to go to another part of the website to cp n' paste over again, cant you just make it use the standard chat box function?
Trigger:

Re: Bships Code Error

Posted: Wed May 27, 2009 6:39 am
by 3ICE
ikillforeyou wrote:kewl, cant you just make it use the standard chat box function?
I will, but not until my exams are over. EDIT: Fail.

I'm already working on my own forum software, so we will be archiving this phpBB bloat and start fresh with a simple black and white forum that allows pure html editing.

I'm planning full HTML and also WYSIWYG, meaning you will be able to post things like
<b>bold</b> for bold,
<i>italic</i> for italic,
<p>paragraph</p> for a paragraph,
<span style="color:yellow">yellow</span> for yellow.

Or even <b><span style="padding:2px;background-color:black"><a href="javascript:for(var x=0;x<3;x++){alert('Hello!');}" title="Hello!"><font color="red">•ː•</font> <font color="white">3ICE</font></strong> <font color="green">•ː•</font></a></span></b>
for [3icessigonwiki][/3icessigonwiki].

All this without having to learn HTML, thanks to the WYSIWYG part :)


p.s.: You created an exact duplicate of trigger 8 by making trigger 9. Oh well:)

EDIT: Of course using <font> tags like I did above will not be allowed. Font tags in XHTML are deprecated.