1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Can this be done?

Discussion in 'StarCraft II Modding' started by M0RT, May 2, 2010.

  1. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    I am not in the beta, so I would like to ask someone who is whether these things are possible in GE:
    1. Special effects - I didn't notice any effect-related functions in starcraft API lists, so is there any way to attach models to units?
    2. Custom unit data - is it possible to add some custom data fields to units and then read them with scripts? I faked this in warcraft by saving the data into hashtable, but that is also not avaiable in galaxy
    3. What is the height limit for units/cameras? (It's a space-themed game, it should be possible to make a fully 3D space game)

    Thanks in advance
     
  2. P-Exodus

    P-Exodus

    Joined:
    Jan 29, 2008
    Messages:
    38
    Resources:
    2
    Maps:
    2
    Resources:
    2
    As I didn't do anything related to your first and third question, I'll just answer your second one:
    Yes, it's possible via this function:

    • Unit - Set (Last created unit) custom value 0 to 100.0


    The 0 is the index for accessing the several values, which can be added to a unit. But you are restricted to real values.
     
  3. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    That is not actually what I meant, what I want here is to store custom data to a unit type, for systems that require some extra unit attributes (example: I am storing unit mass for physics system, to determine how much it is going to be affected by knockback. Or, if I wanted to create a custom hero system with attributes like strength, agility....).
    I could do it by saving it in some array I guess, but I was hoping it could be a part of the new awesome data editor, so I could edit all of the unit attributes, custom and regular, in one place.

    EDIT: to point 1) If there aren't, can someone think of other way of moving 3D models?
     
  4. P-Exodus

    P-Exodus

    Joined:
    Jan 29, 2008
    Messages:
    38
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Ah, ok. Well, you can't add new data field. But there are several ways to edit them with behaviors. Those behaviors can change every aspect of a unit. Attributes like strength, agility, etc (which are behaviors) have to be created from scratch anyway, since they are not included right away. But it's no problem to create them or totally different attributes, which alter any other aspect of your unit.
    There are also a lot of attributes (biological, psionic, heroic, etc) or flags (worker, selectable, invulnerable, etc) which can be edited. Btw, there already is a data field, called 'mass' ;)

    The data editor is really powerfull and pretty complex. So it's difficult to tell, what he really is capable of.
     
  5. Wezthal

    Wezthal

    Joined:
    Jun 7, 2007
    Messages:
    179
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    Actually there are hashtables, they're called Datatables now.
     
  6. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    I know that, but they only allow a single, string, key, which seems to me worse than dual integers.
     
  7. Wezthal

    Wezthal

    Joined:
    Jun 7, 2007
    Messages:
    179
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    I dunno, you can always use Combine Strings(IntegerToString(Integer1),IntegerToString(Integer2)) so it's practically the same.
     
  8. BlueStudios

    BlueStudios

    Joined:
    Jul 4, 2009
    Messages:
    76
    Resources:
    0
    Resources:
    0
    You could always utilize the Custom Value value via triggers (as was suggested already), and you could use triggers to give each unit that is built or created the values they need.

    Example

    • Set Unit Type Custom Stats
      • Events
        • Unit - Any Unit Enters (Entire map)
        • ------- (Comment) This will call from Train, Build and Trigger Create Unit commands
      • Local Variables
      • Conditions
        • (Unit type of (Triggering unit)) == Marine
      • Actions
        • ------- (Comment) Custom 1 = Lockpick Skill
        • Unit - Set (Triggering unit) custom value 1 to 5.0
        • ------- (Comment) Custom 2 = Is Revivable (0 = No, 1 = Yes)
        • Unit - Set (Triggering unit) custom value 2 to 1.0



    Then when each unit is checked for the values to cause things to happen. You would simply use the IF Unit Custom Value (1,2,3) condition.

    You could use this for a few different things via triggers. (Unfortunately, there is no 'Validator' that I could find that checks custom values, so this has to be done in triggers.)
     
  9. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    Yes, you can "create" any strings you need, the problem is actually that you can't flush all data related to a handle, when that handle dies (unit/timer/dialog...), you'll have to keep track of which values you used for that handle. On the other hand, since there are structs avaiable, you may need to save exactly 1 value for each unit (IF you can save structs...). Btw. can you make structs in GUI?

    And yes, multiple custom values are another option, although they can't save anything but integers...
     
  10. mrzwach

    mrzwach

    Joined:
    Aug 1, 2009
    Messages:
    929
    Resources:
    3
    Tutorials:
    3
    Resources:
    3
    You can create multi-dimensional variable arrays, with up to 4 dimensions.

    IE i[1][2][3][4].

    It seems to me the best way to do this is just use two dimensional arrays. You have to make a seperate one for each var type you are using, but meh.
     
  11. Wezthal

    Wezthal

    Joined:
    Jun 7, 2007
    Messages:
    179
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    Real values, actually. Each unit has a single One Dimenstional Real Array.
     
  12. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    Thanks, you both bring good news, however I would like if someone could answer the other two questions, which are more important to me (especially number 1, that one decides wheter I can make my map or just forget about it and stay with warcraft)

    Also, I have another question, regarding this blizzard comment:
    Code (vJASS):
    // Besides numerical types (byte, int, fixed), a few complex types support + and/or - operators:
    //
    //      string, text    + operator will concatenate the strings or text
    //      point           +/- operators will add or subtract the x and y components of the points

    Does it mean I can create points like this:
    Code (vJASS):

     point a = b + c // b and c beeing points. Also, is this now the way you declare locals, since it uses C syntax?
     


    EDIT: question nr.5: Is there some limit for number of elements on dialog? (I would need to create a dialog with ~100 buttons, would that work?)
     
  13. Wezthal

    Wezthal

    Joined:
    Jun 7, 2007
    Messages:
    179
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    If there's a limit, it's about 100, but I think you can go atleast a little bit 100 for sure. (this I have tested.)

    I will investigate the other things you asked and I'll try to reply with more information later on.

    EDIT: I was suprised but it gives no error. It seems you can do that:
    "Point 1 = Point 2 + Point 3"

    About height limits, do you mean high or low limit? (up or down) Because I think you can go up atleast as long until you can't really see anything anymore and you should be able to go below the current terrain level aswell so, whatever your goal with this is, I'm sure you can do it.
     

    Attached Files:

    • n3.JPG
      n3.JPG
      File size:
      14.1 KB
      Views:
      53
  14. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    Thanks for the point test (I assume it would even work when you add two non-null variables).
    Height limit: Both, low and high, or basically the difference between them (and if it was hight enough to allow 3D game, like flight simulator)
     
  15. Wezthal

    Wezthal

    Joined:
    Jun 7, 2007
    Messages:
    179
    Resources:
    9
    Icons:
    8
    Skins:
    1
    Resources:
    9
    Ok about the height limit, for a flight simulator I think the limit is quite sufficient:
    (That tiny gray dot in the center is a Terran Battlecruiser. The smaller image shows the Battlecruiser in as it appears in Melee games.)
     

    Attached Files:

    • n4.JPG
      n4.JPG
      File size:
      69.1 KB
      Views:
      83
    • n5.JPG
      n5.JPG
      File size:
      63.7 KB
      Views:
      74
  16. mrzwach

    mrzwach

    Joined:
    Aug 1, 2009
    Messages:
    929
    Resources:
    3
    Tutorials:
    3
    Resources:
    3
    #1 should be possible via the data editor, using actors. Have yet to actually try it though.
     
  17. Omniferous

    Omniferous

    Joined:
    Jul 4, 2007
    Messages:
    174
    Resources:
    0
    Resources:
    0
    This is already stored for you under Stats - Mass. This affects the push and pull mechanics already in game.

    This is correct. I've confirmed it. Attach actor models to a point or a unit.
     
  18. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    So actors are basically 3D models that can be moved rotated, animated, can talk, and can't do anything else? That would be exacty what I need...
    Could I ask someone to test trigger that moves ~1000 actors around as often as possible? (10 "mounting" units, 200 actors each) I would be very grateful, especially if it runs smoothly :grin:
     
  19. gkill25

    gkill25

    Joined:
    May 7, 2010
    Messages:
    1
    Resources:
    0
    Resources:
    0
    I tried it out made 10 ultralisks 100 marines and 100 zerglings on each for a total of 2000 actors.

    When the periodic effect was set to .1 seconds to make them do an attack animation it was really bogged down and they didn't even flinch. When set to .5 seconds it had a bit of slow down on every period but they all did their animation. Probably if you put in a slight wait time every 100 or so actors you can get rid of the delay.
     
    Last edited: May 7, 2010