I'd like to create a unit from scratch using the data editor. I believe that the bare minimum I need is to create a Unit, an Actor (of type Unit), and a Model, and assign the Model to the Actor and the Actor to the Unit. I can create the model (and give it my custom m3 file), and know how to create Units and Actors, but am not sure how to assign these. Any ideas?
My main problem was linking the model, unit, and actor. I figured out that you do both of these in the actor: modify its model art, and its unit name (this field is separate from the others). I'll still have to tinker with the other fields of the unit and actor to get things like movement (for some reason, the move button doesn't show up in the command card even though I've set all the fields).
You need to add the ability to the unit before adding the ability to the command card via the Ability - Abilities - Ability field (above fields for command card).
To link the actor to the unit you need to open the events tab of the actor and get the actor to be created on unit birth. To do this use a Unit Birth event and specify your unit in the Source Name tab. There is a field called Animation - Walk Animation Movement Speed, this sets how fast the actor looks like it is walking when using the Move ability.
I am currently having trouble getting basic animations like "Stand" and "Walk" working. The animations are definitely in my custom m3 model, as shown if I just create a model through the script:
Which shows the coin spinning according to its Stand animation. However, if I create a coin unit, it does not show any animations. A few days ago I actually had a working unit with the stand animation, so it can't be too hard, but I can't figure out how I did it...
Edit: Reloaded the map, and it worked... this is not the first time that reloading the map editor is enough to make something work.
Edit 2: Made a few more minor changes, and now the animations no longer work. I think I'm missing something trivial, or there is some inconsistent SC2.
Edit 3: I can get the Stand animation to work consistently using the script:
ActorSend(myUnitActor, "AnimBaselineStart")
where myUnitActor is the main actor of the unit I created.
Birth Stand Death. (BSD) I'll let someone with more data knowledge continue the explanation. I'm a noob data artist too and was hoping for more info here :P. I guess i'll come back!
I suspect that this does essentially the same thing as Animation Baseline Start. It turns out that all of these actor events have corresponding scripts (which just call ActorSend with a certain string), and those are documented here on sc2mapster. I'm not sure yet if I prefer doing things via the data editor or scripts, but it's nice to test things out with both.
Edit: The XML files (Core.SC2Mod and Liberty.SC2Mod) for actors are good places to see how the events are set up. The reason animations don't play by default is that GenericUnitStandard and its parents don't have "AnimBaselineStart" or "AnimBracketStart BSD Birth Stand Death" on ActorCreation.
Well Try using what animations it does have for those slots then. Else try asking on the artist tavern forum. Try getting comfortable with ingame actor models first before importing ones with odd animation names. Remember they are capital sensitive.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
So the problem seems to be the way I'm creating the unit. When I create any unit (even existing ones from SC2) using a trigger or script, the standing and walking animation don't play. Oddly enough, the Death and Attack animations do play when they should. Everything works if I place the unit in the terrain editor, but for my map I would much rather control things through script.
Maybe this is a question better asked in the trigger or script forums, but the solution probably involves setting up the right actor events in the data editor. In fact, if in the unit actor I tell it to Create on UnitCreation, then my unit gets two models, one of which is static (as before), and the other which moves properly, and SC2 throws an error saying "two actors created for the same unit". I am going to try removing all other Create messages from the events, but this seems like it might screw up other behaviors such as building the unit.
Edit: Fixed by changing the options to UnitCreate from c_unitCreateConstruct to 0. Both SC2 units and my custom unit now work properly.
I'd like to create a unit from scratch using the data editor. I believe that the bare minimum I need is to create a Unit, an Actor (of type Unit), and a Model, and assign the Model to the Actor and the Actor to the Unit. I can create the model (and give it my custom m3 file), and know how to create Units and Actors, but am not sure how to assign these. Any ideas?
@XPilot: Go
Go create a model, experiment - go create an actor, experiment
My main problem was linking the model, unit, and actor. I figured out that you do both of these in the actor: modify its model art, and its unit name (this field is separate from the others). I'll still have to tinker with the other fields of the unit and actor to get things like movement (for some reason, the move button doesn't show up in the command card even though I've set all the fields).
You need to add the ability to the unit before adding the ability to the command card via the Ability - Abilities - Ability field (above fields for command card).
To link the actor to the unit you need to open the events tab of the actor and get the actor to be created on unit birth. To do this use a Unit Birth event and specify your unit in the Source Name tab. There is a field called Animation - Walk Animation Movement Speed, this sets how fast the actor looks like it is walking when using the Move ability.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Worked! Thanks for the tip! And I didn't have to modify any actor events, they all appeared automatically...
So what is the next issue you are facing with making a unit from scratch. I can teach you all the basic tricks especially visually related ones.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
I am currently having trouble getting basic animations like "Stand" and "Walk" working. The animations are definitely in my custom m3 model, as shown if I just create a model through the script:
ActorCreate(null, "TriggerModel", "Coin", null, null);
Which shows the coin spinning according to its Stand animation. However, if I create a coin unit, it does not show any animations. A few days ago I actually had a working unit with the stand animation, so it can't be too hard, but I can't figure out how I did it...
Edit: Reloaded the map, and it worked... this is not the first time that reloading the map editor is enough to make something work.
Edit 2: Made a few more minor changes, and now the animations no longer work. I think I'm missing something trivial, or there is some inconsistent SC2.
Edit 3: I can get the Stand animation to work consistently using the script:
ActorSend(myUnitActor, "AnimBaselineStart")
where myUnitActor is the main actor of the unit I created.
So you tried under events getting it to play the BSD animation?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Not sure what the "BSD" animation is. Also, I do have the UnitBirth => Create Actor Event.
Birth Stand Death. (BSD) I'll let someone with more data knowledge continue the explanation. I'm a noob data artist too and was hoping for more info here :P. I guess i'll come back!
Under the events of the actor itself have Actor Creation => Animation Bracket Start.
Set the name to BSD with the opening playing the birth animation, the content playing stand and closing playing death.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
I suspect that this does essentially the same thing as Animation Baseline Start. It turns out that all of these actor events have corresponding scripts (which just call ActorSend with a certain string), and those are documented here on sc2mapster. I'm not sure yet if I prefer doing things via the data editor or scripts, but it's nice to test things out with both.
Edit: The XML files (Core.SC2Mod and Liberty.SC2Mod) for actors are good places to see how the events are set up. The reason animations don't play by default is that GenericUnitStandard and its parents don't have "AnimBaselineStart" or "AnimBracketStart BSD Birth Stand Death" on ActorCreation.
So I've tried setting up the BSD actor event, but my unit still doesn't switch to its walking animation when moving...
Well Try using what animations it does have for those slots then. Else try asking on the artist tavern forum. Try getting comfortable with ingame actor models first before importing ones with odd animation names. Remember they are capital sensitive.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
So the problem seems to be the way I'm creating the unit. When I create any unit (even existing ones from SC2) using a trigger or script, the standing and walking animation don't play. Oddly enough, the Death and Attack animations do play when they should. Everything works if I place the unit in the terrain editor, but for my map I would much rather control things through script.
Maybe this is a question better asked in the trigger or script forums, but the solution probably involves setting up the right actor events in the data editor. In fact, if in the unit actor I tell it to Create on UnitCreation, then my unit gets two models, one of which is static (as before), and the other which moves properly, and SC2 throws an error saying "two actors created for the same unit". I am going to try removing all other Create messages from the events, but this seems like it might screw up other behaviors such as building the unit.
Edit: Fixed by changing the options to UnitCreate from c_unitCreateConstruct to 0. Both SC2 units and my custom unit now work properly.
So solved?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Yep! I am now working on the attack, but I'm using the other thread to ask about that.