• 0

    posted a message on Is there any way to have a function return more than 1 variable?
    Quote from s3rius: Go

    1) Use Global Variables. Your function sets these variables to some value, and the caller can then read the variables and use them. 2) Same as above, but instead of Global Variables you use one Global Record in which you store all variables.

    How costly are locks going to be if I expect somewhere around a maximum of 3-4 threads trying to use it at the same time? Because locks are the only way global anythings are going to work.

    Quote from Ahli634: Go

    Also, I have no idea why someone should use records ever... just use global variables.

    On my last project I never used records, just globals. It got pretty messy. If you ever have a number of arrays sharing the same size (usually when its one for each player or something) turning them into records instead is a great way to reduce clutter. I hate having more than a full screen when using the Set Variable function.

    Since I just need two integers, is it possible to pass back an integer array? If so, how do I handle it on the receiving end? Do I need an array of the exact same size to avoid overflows?

    Posted in: Triggers
  • 0

    posted a message on Is there any way to have a function return more than 1 variable?

    @BasharTeg: Go

    Why would you ever want to return an object in java? Objects potentially have more than 1 piece of information in them, why would you want to return something with multiple values?

    I have a record called Item that stores information about how I want it to work. In order to easily pick random items appropriately for certain conditions, I have each item categorized by class, which is just an integer array. In order to conveniently store all of my items of a class, they're also an array. Its not a 2 dimensional array exactly, but you can think of it like that.

    Now, in order to access a specific item in a 2 dimensional array, you need both dimensions. If I could return a record, I could just copy the Item outright, but I can't, so I need to return both values.

    Posted in: Triggers
  • 0

    posted a message on Is there any way to have a function return more than 1 variable?

    From what I understand the best way to collect items is in a record, but it seems impossible to return a record. If this is possible and I just haven't realized how please let me know.

    I have two workarounds so far, both of which are pretty hackish. Units can store unlimted reals in their custom values, and can be returned. Strings can be parsed, so you can encode your values in them. Neither of these are intuitive in the least, though.

    Is there anything that will just feel 'right'?

    Posted in: Triggers
  • 0

    posted a message on Anybody good at project design want to give me a few pointers?

    @Mozared:

    Good project design will still alleviate my problem of regularly changing my data structure.
    If I'm changing the parameters a function takes a couple times a day, there's definately some lack of planning going on. How much should I plan out before beginning to do any work? There's some balance to achieve, because if I have no plan my work will be sloppy and disjointed. If I plan the entire project before working on it, and find 5 hours in that Plan System 3 isn't something I know how to make, I'm not going to be able to fit the design.

    @Alevice:

    I haven't really noticed Data Tables before. Is there any general situation where I should consider using them?

    @OutsiderXE:

    Initialization code is a lot simpler than most other triggers. Do you have any pictures of more complicated but well ordered triggers?

    Posted in: General Chat
  • 0

    posted a message on [solved] Multiple Simultaneous Text Tags

    You need to use Data to handle this, not Triggers.

    Posted in: Triggers
  • 0

    posted a message on Anybody good at project design want to give me a few pointers?

    I'm creating a map, and some things are turning out more sloppy than I'd like. I'm arranging things as best I can, using records to store similar variables, creating functions and actions to handle common tasks, encapsulating existing functions to get specific consistent results out of them, etc. But I'm still getting long, confusing is/else or switch statements, occasionally changing my variable data's structure, etc. This often is something I'll just deal with, but I expect to include new people on this project if its going to be finished, and I need them to be able to understand what's going on when they join.

    I'd like to know if somebody who is good at making really clean code could help me out, either through just general suggestions, or directly answering some of my issues.

    Posted in: General Chat
  • 0

    posted a message on What is a Good Amount of Abilities for a Hero?

    I'm a fan of the Demigod game's style. There are something like 8 abilities, including a couple 'superior/ultimate' style ones, and they each have 4-5 levels so you can't get them all. So, even if two people have the same character, they'll be different unless they go the exact same build.

    Posted in: General Chat
  • 0

    posted a message on PLEAST TEST: Transcendence RPG

    I want a team of like 4 people, so I'd rather schedule a time rather than PM people at random.

    http://www.sc2mapster.com/forums/player-zone/map-feedback/21942-please-test-transcendence-rpg-video-included/
    There's his old topic, if you like you can see what changes he already made. Like, I think he wants the respawn to really suck, because I mentioned how brutal it was and not much has changed since then.

    Posted in: Map Feedback
  • 0

    posted a message on PLEAST TEST: Transcendence RPG

    Anybody want to agree on a time to meet up and play this? I nailed a few bugs the last time he asked, but it was all single-player. I want to actually try to beat the game this time.

    Posted in: Map Feedback
  • 0

    posted a message on Has anybody made a map where the goal is to create, rather than kill or compete against other players?

    I like your ideas, sure, but like I said, you're trying to use global banks which don't even exist, and I wouldn't know where to begin creating some kind of utility to do that for me.

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on Has anybody made a map where the goal is to create, rather than kill or compete against other players?

    There's a significant difference between competing with other players where only 1 wins, and playing cooperatively where all win or lose together.

    I don't want to argue this issue. I'm just interested in somebody already having this kind of project, or a great idea that I think I can implement myself.

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on Has anybody made a map where the goal is to create, rather than kill or compete against other players?

    Its entirely possible for the players to work together towards a defined goal rather than competing to reach it first.

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on Has anybody made a map where the goal is to create, rather than kill or compete against other players?

    That's creating a competitive nature that I'm not sure I want to exist in a map like this.

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on 1v1 Tournement Idea

    You can't use maps larger than 128x128, but yeah, its possible. Well, I guess you could do 128x256 or 256x128, but then its 4 players only.

    Just like the current 1v1 obs maps, you have triggers that group people up, and spawn their buildings, and replaces resources, etc. There are trigger functions to limit the camera bounds to a certain area, so just set it up for whatever arena they're in.
    Once one person wins, give both players vision of the entire map so they can watch other games before starting their next match.

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on Has anybody made a map where the goal is to create, rather than kill or compete against other players?

    That still doesn't really explain what the goal of the map would be. And the way you explain a lot of the things working, would require better AI than I'm probably capable of creating, unfortunately.

    Posted in: Map Suggestions/Requests
  • To post a comment, please or register a new account.