Spawn Characters with Corresponding behaviors

Hi,this practice work is developed from my last Star Wars FPS practice,I tried to spawn Scout Trooper,but I can’t get Action and Variables within spawned characters work at that time,now I’v found the trick.


click here to run HTML5 result
The trick is that you have to adapt the idea about Object Oriented design, use the Self to assign target objects,get Armature name with get child - contains-name of your Armature, apply even for child objects attached like weapons,and use property instead of Variables to trigger logic nodes,then all these can trace back to property contained in spawned characters,and finally make children work.
selfPropery
assign target objects with Self and Get Child for Animation selection or attached weapon


Set up a property as integer to stand for State instead of using Variable

Here is my original Blender file,try it out and share me with how to improve it,enjoy!

*animation: mixamo
*models: sketchfab

Darth Vader by Stym

stormtroops by jettaroni10
scout trooper by Leonardo Benavides

WSAD to walk ,mouse to look ,left mouse to shoot,space to jump

2 Likes

Here is an example of how to use variables.(https://github.com/armory3d/armory_examples/blob/master/logic_examples/linked_variable.blend)

Although it is a little difficult to notice, you need to enter the ID field of the node tab.1

2 Likes

Thanks again,Sandy
I’m trying this new feature of Armory3D with your hint now,I think I mixed it up with Lable (kind of like an Identity )before,now I realize that it’s handled by Node tab fields,one thing I don’t get is what it work for mainly,does it simply make a linked Variables instance or it counts for identifier in loop procedures like spawn object?


It stocks after I add IDs to Variable of Stormtrooper while spawning it out at first time,
although I’m not figuring it out yet,I’m still happy to get a new path to try it,I’ll try it out further,and I’ll have two kinds of template if I debug it out then, thanks for your kindly help,Sandy!

Is this what you want to do?1

1 Like

Thanks for your reply,Sandy
I can manipulate value within Variable,
I just want to know what’s the purpose to assign an ID to Variables ,what does it work for,since it doesn’t work like Property that can trigger relative logic nodes for spawned character at beginning,instead Variables with ID still remain idle not as I expect then,so I assume it must work like a linked variable like a short cut with your post image,or something like usage in Quest3D as blow

Thank you,@Sandy!
I figure it out now!
It did work for spawned objects and can be effective copies of specified single Variables which can be used in other branches of tree without messy linking lines,that’s what I’m looking for!

Thank you again! This can help organizing a neat layout of logic trees,that’s great!


It’s confirmed that Variables with ID can work like Property trigger relative Nodes for spawned characters or objects.
edit: the error that I failed at begging is caused by assigning Nodes trait to wrong level of my character,I should assign the node tree to the top level of the character which is the outter box.

1 Like