So I want to add to a unit a certain behavior, now there are two "Add Behavior" ways on triggers which are "Add behavior" and "Add behavior (player)". "Add Behavior" says "Add [number] [behavior] to [unit] from [unit], same thing with "Add Behavior (player)" except "from [player]". My question is why do you need "from [unit/player]"? I just want to add a behavior to a unit, and that's it, what does "from [unit/player]" has to do anything with this?
This might possibly be the true in your case but think of - for example - kill credit or a behavior which transfers life to the source unit and so on...
If you have effects, behaviors, actors, etc. tied to the behavior, these things might break if you don't assign a source when adding the behavior via triggers. This is more likely to become a problem if you create the same behavior through data AND triggers. For example, if you have a weapon create a behavior on the target unit, which in turn creates an effect on the Source unit, the latter effect would create an error if the former behavior were added to a unit via Player or if no unit is specified. A life-leech effect comes to mind as an example. If you were to create the life drain debuff via triggers and specified the source as Player or no unit, the game would have no idea where to send the stolen HP.
Oh, well that makes a little bit more sense. But what if the behavior is independent of the source or host? Then I guess the source isn't useful, right?
If your behavior has no connections to other effects/behaviors/etc. through the Source and you don't plan on referencing a unit or player with triggers, then the Source is not used so it wouldn't matter how the behavior was created.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I want to add to a unit a certain behavior, now there are two "Add Behavior" ways on triggers which are "Add behavior" and "Add behavior (player)". "Add Behavior" says "Add [number] [behavior] to [unit] from [unit], same thing with "Add Behavior (player)" except "from [player]". My question is why do you need "from [unit/player]"? I just want to add a behavior to a unit, and that's it, what does "from [unit/player]" has to do anything with this?
@joemart06: Go
Either one will add the desired behavior. The difference is the "source," which can be referenced by either data or triggers.
@BasharTeg: Go
Exactly, but why would it need a source? I just feel that either way the source isn't doing anything.
@joemart06: Go
This might possibly be the true in your case but think of - for example - kill credit or a behavior which transfers life to the source unit and so on...
@joemart06: Go
If you have effects, behaviors, actors, etc. tied to the behavior, these things might break if you don't assign a source when adding the behavior via triggers. This is more likely to become a problem if you create the same behavior through data AND triggers. For example, if you have a weapon create a behavior on the target unit, which in turn creates an effect on the Source unit, the latter effect would create an error if the former behavior were added to a unit via Player or if no unit is specified. A life-leech effect comes to mind as an example. If you were to create the life drain debuff via triggers and specified the source as Player or no unit, the game would have no idea where to send the stolen HP.
Oh, well that makes a little bit more sense. But what if the behavior is independent of the source or host? Then I guess the source isn't useful, right?
@joemart06: Go
If your behavior has no connections to other effects/behaviors/etc. through the Source and you don't plan on referencing a unit or player with triggers, then the Source is not used so it wouldn't matter how the behavior was created.