• 0

    posted a message on Are Linked Lists Possible?

    You can do it if you have 3 arrays:
    - The actual values (can be integers or strings or units or whatever).
    - The position of the next element in the list (must be integers).
    - An array of all the "open" positions in the previous arrays. This is needed to recycle the linked lists (must be integers). You will also need an integer to keep track of the number of valid open position. So for example if you have 3 free spot then the first (or, depending on your implementation, last) 3 elements in these arrays are free to use when someone needs to create a new linked list or add elements to an existing linked list.

    Example with strings (I show arrays of length 4 with each of the elements separated by a ','):
    ["e", "q", "H", "y"]
    [3, 2, 0, -1]
    [1, -1, -1, -1] (Free spots: 1)

    This would mean that you have a linked list at location 2, namely "Hey". You start at "H", next location is location 0 which is "e", next location is 3 which is "y", the -1 means that "y" is the last one in the list.
    The location of "q" is free (there should be no "reference" to this location at this moment).

    As long as you create the arrays to be big enough and you aren't scared to do your own little memory management, you can make your linked lists like this.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Incomplete Project to Good Team

    @GlornII: Go The video he posted is one from an actual iPhone game (called Battle of Nesnoth) he is trying to copy for Starcraft 2 (called WesCraft).

    Posted in: Team Recruitment
  • 0

    posted a message on What language would be most useful to learn?
    Quote from Mozared: Go

    From what I've found, German is really only useful in Germany and French only in France. Spanish is useful in Portugal, Spain, half of south-America, mid-America and some African colonies. I think it's the most widely spoken language, even beating English and Chinese on that. Unless you're specifically planning on spending time in a country where they speak French or German, I'd go with Spanish or Chinese.

    Keep in mind that Chinese is one of the hardest languages in the world, though, if not the hardest (here's an informative link that a pall who lives in China has given me). For as far as I know, you can spend four years studying the language and you'll still be speaking it at a child's level. While it might give you an edge, if you want to tap in to globalization then mastering Spanish in those four years seems like a better bet.

    Some fixing is required:
    German: http://wiki.answers.com/Q/In_what_countries_is_German_the_official_language
    French: http://en.wikipedia.org/wiki/List_of_countries_where_French_is_an_official_language
    Spanish: http://en.wikipedia.org/wiki/List_of_countries_where_Spanish_is_an_official_language

    The most spoken languages in the world:
    http://www.davidpbrown.co.uk/help/top-100-languages-by-population.html
    Spanish is second after Chinese Mandarin.

    Posted in: Off-Topic
  • 0

    posted a message on Income Redistribution

    @CrazyTwigman: Go

    The solution I posted above is in the right direction to solve part of your problem you listed.

    Each time interval you will need to set the MoneyPerTeam variable to be 2 * (number of players in the team with alive heroes + players that left with a living hero) and then distribute among the people with living heroes in the team.
    You'll also need to replace all arrays by simple variables since you'll only need to do this for 1 team. This of course means that the outer loop of "General - For each integer Team from 0 to 1 with increment 1, do (Actions)" will not be present in your solution.

    As a side note: Giving an advantage of leaving over dying means that people will leave as soon as they see that they are about to die. If people don't leave they will get flamed at by other players. (Except if there is a good reason for them to stay until the end of game.)

    Posted in: Triggers
  • 0

    posted a message on [Solved] Bank - Check Section Fail

    This is my guess:
    It says "preload" which would means that the banks are send before the map actually start (as a lot of data is send around which can take time) and thus not on the moment you would expect. This means that Starcraft 2 needs to know which banks it needs to preload for who even before the triggers are run and this means that it won't bother to see which values the variables have and thus cause variables to fail.

    Posted in: Triggers
  • 0

    posted a message on [Solved] Bank - Check Section Fail

    This might be a wild shot but I had similar problems with banks and it seemed that you can't Preload and Synchronize a player variable, it needs to be a constant.
    So you need to have a separate action for each bank synchronization.
    Bank - Preload and synchronize bank "Stats" for player 1
    Bank - Preload and synchronize bank "Stats" for player 2
    Bank - Preload and synchronize bank "Stats" for player 3
    ...

    As a side note, you might want to pick each player in the player group Active Players in case that for example Player 1 slot is not used (for example due to disconnect on map load) and will cause the last player to not get his bank loaded.

    Posted in: Triggers
  • 0

    posted a message on Better wander AI

    @Naxxum: Go

    The faster that your listed action is spammed, the more they will end up in the middle. This is because far away locations (for example in the side of the map) are overwritten by a new order to another location before it reached it.

    Posted in: Triggers
  • 0

    posted a message on Crater of Carnage Off Topic Thread

    I'll prolly get murdered for this by the people hoping to get paid but ... if you wait long enough you can take a lot of the triggers from Blizzard Dota (which I suppose to be open source like the previous maps) and modify them to your needs.

    Posted in: Off-Topic
  • 0

    posted a message on Crater of Carnage Off Topic Thread

    Ok was just checking to see if you weren't in for a nasty surprise.
    They did say more concrete stuff though like that there will be only 3 stats which were health, damage and mastery ( at 28:49) and showed a picture of all the (19) items (Same movie at 29:55). The removing last hitters is also in that movie.

    Posted in: Off-Topic
  • 0

    posted a message on Crater of Carnage Off Topic Thread

    Have you seen the Starcraft Dota movies and the idea's they put forward there?

    They also talk about being more accessible gameplay / removing last hitters / classifying hero roles / sharing money on hero kills / simplifying gear / ... .

    Posted in: Off-Topic
  • 0

    posted a message on Sc2 vs Wc3 Maps: What's wrong in recent maps.

    WC3 is old. (released July 2002, 1 expansion July 2003)
    SC2 is new. (released July 2010, no expansion yet)

    I don't remember WC3 having awesome maps when it was young either, especially not before the expansion as that opened a lot of new possibilities.

    Now go back to mapping guys and SC2 can still have better maps.

    Posted in: General Chat
  • 0

    posted a message on The Black Road Remake

    Awesome map, but as Neonsz said this is a big big project if you want to go for it.

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on Income Redistribution

    Glad to have helped :). Hopefully your project will turn out to be great :).

    Posted in: Triggers
  • 0

    posted a message on Income Redistribution

    Hey,

    Sorry for the late response. I hadn't logged in for a couple of days.

    The good news is that I found the problem :).

    Each time the trigger runs (so every 3 seconds), it "forgets" the values of the local variables. This means that every tick the "MoneyNotGivenYet" variable is reset to 0 causing it to not carry over any money.

    In order to fix this problem, create a new GLOBAL variable called "MoneyNotGivenYet" and replace all local variables of "MoneyNotGivenYet" by this. In the end you should delete the local variable completely to make sure you didn't accidentally forget to change it somewhere (as it will give a warning if you still have it somewhere in your code).

    Let me know if you still have problems, otherwise I can upload the map I have where it seems to works. Also note I changed my original post.

    No_exit

    Posted in: Triggers
  • 0

    posted a message on Income Redistribution

    The following should do what you want to do. It will give as much money as it can to each player that it can in a fair form (so not favoring any player). Any money that couldn't be distributed (for example distributing 5 minerals over 2 players will not work, you will have 1 mineral remaining) will be carried over to the next distribution.

    Trigger window:
    Teams = (Empty player group) <Player Group[1]>
    MoneyNotGivenYet = 0 <Integer[1]>
    Money Per Turn
    Player Leaves

    Note: You will need to add the players to the player group variable "Teams" yourself, do check if the slots are actually occupied by players or not. Here I set it up for 2 teams, namely Teams[0] and Teams[1].

    Trigger Money Per Turn

    Money Per Turn
        Events
            Timer - Every 3.0 seconds of Game Time
        Local Variables
            MoneyPerTeam = 5 <Integer (Constant)>
            MoneyPerPlayer = 0 <Integer>
            Team = 0 <Integer>
            TeamMembers = 0 <Integer>
        Conditions
        Actions
            General - For each integer Team from 0 to 1 with increment 1, do (Actions)
                Actions
                    Variable - Set TeamMembers = (Number of players in Teams[Team])
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            TeamMembers > 0
                        Then
                            Variable - Set MoneyPerPlayer = ((MoneyPerTeam + MoneyNotGivenYet[Team]) / TeamMembers)
                            Player Group - Pick each player in Teams[Team] and do (Actions)
                                Actions
                                    Player - Modify player (Picked player) Minerals: Add MoneyPerPlayer
                            Variable - Set MoneyNotGivenYet[Team] = ((MoneyPerTeam + MoneyNotGivenYet[Team]) - (MoneyPerPlayer * TeamMembers))
                        Else
    


    Note: Super important that you use Integers and use the exact order of the brackets I put in my triggers. In integer maths 5/2 = 2 (and not 2.5 and not 3). This means that if you have 2 players in a team they will get 2 minerals the first 3 seconds and 3 minerals the next 3 seconds (then it continues 2-3-2-3, ...). If you ever want to give a different amount then 5 minerals to the team, then it will still work.

    Trigger Player Leaves

    Player Leaves
        Events
            Player - Player Any Player leaves the game with Any
        Local Variables
        Conditions
        Actions
            Player Group - Remove player (Triggering player) from Teams[0]
            Player Group - Remove player (Triggering player) from Teams[1]
    


    Posted in: Triggers
  • To post a comment, please or register a new account.