Bships Code Error

Do you need World Editor help? Ask here!
Forum rules
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)
ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post 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?

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Bships Code Error

Unread post 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.
ImageImageImageImageImage
Image
ImageImage

ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post 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

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Bships Code Error

Unread post 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.
ImageImageImageImageImage
Image
ImageImage

ikillforeyou
Posts: 30
Joined: Sat Nov 22, 2008 4:10 pm

Re: Bships Code Error

Unread post 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:

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Bships Code Error

Unread post 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.
Last edited by 3ICE on Sun Mar 06, 2011 9:25 am, edited 2 times in total.
Reason: Yeah, I kinda forgot about this...
ImageImageImageImageImage
Image
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users and 109 guests