Page 1 of 1

printing piece hierachy of a unit

Posted: 17 Apr 2011, 23:08
by knorke
A widget to create an ascii view from the piece hierachy of a unit/model.
I used to make notes by hand as as not to forgett the names of pieces. Now its automagic :shock:

/give simplewalker

Code: Select all

  *** pieces tree of simplewalker ***
base
 -body
 --hip_left
 ---leg_left
 ----foot_left
 --hip_right
 ---leg_right
 ----foot_right
/give simpleattackvehicle

Code: Select all

 *** pieces tree of simpleattackvehicle ***
 base
 -body
 -turret
 --barrel
 ---flare
 -wheel1
 -wheel2
 -wheel3
 -wheel4
and a long one

Just read it in console or copy it from infolog to keep it as reference.
It prints such thing on every UnitCreated but only when /cheat is enabled. (as not to spam all the time)

/edit
sex change from gadget to widget

Re: printing piece hierachy of a unit

Posted: 17 Apr 2011, 23:11
by jK
why is it a gadget?

Re: printing piece hierachy of a unit

Posted: 17 Apr 2011, 23:13
by knorke
Spring.GetUnitPieceInfo not on http://springrts.com/wiki/Lua_UnsyncedRead

Re: printing piece hierachy of a unit

Posted: 17 Apr 2011, 23:15
by jK

Re: printing piece hierachy of a unit

Posted: 17 Apr 2011, 23:24
by knorke
search&replace in progress.
didnt really understand that page before. Now maybe just did.
The Lua_SyncedRead / LuaUI field is yellow and says "with special LOS handling and decoy unit handling"
so everything from syncedread pageworks in unsynced too, just that you can only get your own units (+those in los) and that the unitIDs are "faked" to prevent cheating?

Re: printing piece hierachy of a unit

Posted: 18 Apr 2011, 00:09
by Beherith
drill_named_zeroed.3ds
-base
--baseplate
Use 'swap' in upspring to get rid of empty 3ds import base pieces.

Re: printing piece hierachy of a unit

Posted: 18 Apr 2011, 00:24
by knorke
yes thanks but i figured that out already. (was an old model)
renaming that piece works too. for some things i find it usefull to have
empty base
-body
--stuff

Re: printing piece hierachy of a unit

Posted: 18 Apr 2011, 00:35
by Beherith
Useful tool though :)
I'm so dumb I coded this in python a while ago :P

Re: printing piece hierachy of a unit

Posted: 18 Apr 2011, 02:15
by Forboding Angel
Needs a conditional other than cheat being on.

I use cheat and give all the time and would prefer to be able to add this to evo so I have it available when I need it but not print all the pieces and stuff out everytimes I do a /give

Re: printing piece hierachy of a unit

Posted: 18 Apr 2011, 14:56
by knorke
forb, its a widget now meaning you can just toggle it in F11 list.
i wouldnt put it in evo but in luaui\widgets of your engine install as not to confuse players with it.