• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Can this be done?

Status
Not open for further replies.
Level 12
Joined
Apr 15, 2008
Messages
1,063
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
 
Level 7
Joined
Jan 29, 2008
Messages
47
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.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
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?
 
Level 7
Joined
Jan 29, 2008
Messages
47
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.

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.
 
Level 4
Joined
Jul 4, 2009
Messages
77
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.)
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
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...
 
Level 11
Joined
Aug 1, 2009
Messages
963
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.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
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:
JASS:
// 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:
JASS:
 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?)
 
Level 9
Joined
Jun 7, 2007
Messages
195
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?)

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.
 

Attachments

  • n3.JPG
    n3.JPG
    14.1 KB · Views: 75
Level 9
Joined
Jun 7, 2007
Messages
195
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.)
 

Attachments

  • n4.JPG
    n4.JPG
    69.1 KB · Views: 120
  • n5.JPG
    n5.JPG
    63.7 KB · Views: 92
Level 5
Joined
Jul 4, 2007
Messages
166
example: I am storing unit mass for physics system, to determine how much it is going to be affected by knockback...

This is already stored for you under Stats - Mass. This affects the push and pull mechanics already in game.

#1 should be possible via the data editor, using actors. Have yet to actually try it though.

This is correct. I've confirmed it. Attach actor models to a point or a unit.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
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:
 
Level 1
Joined
May 7, 2010
Messages
1
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:
Status
Not open for further replies.
Top