|
Re: How to create a keyword for each entity at runtime??
[Re: LavenderSs]
#225231
09/03/08 13:35
09/03/08 13:35
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Couple of questions I need before I can think about this.
1> About how many Humans are we talking here ? ( 5, 10, 50, or 500 ? )
2> Do they have Actions attached to them ? Is it always the same action ? Can we have the option to ADD a new action to them ?
3> Is it feasable for you to go though them all in WED and type a unique number into one of their skills? (last resort option)
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: How to create a keyword for each entity at runtime??
[Re: LavenderSs]
#225333
09/04/08 03:19
09/04/08 03:19
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK heres something I put together for you, let me know if it is suitable for what you need. This function lets you do everything at run-time too, it can be used with any entity, with or without actions. Usage is simple, :- 1> The first parameter is "Parent" which in your case is the Human Model to hover over. 2> The second parameter is "FloaterFilename" which is the bmp/pcx/etc OR MDL you want to use as a Sprite. 3a> Also read the included comments to help understand how it works. Give it a try (Ive already tested it) and if you need to tweak it height above its parent, adjust BOTH the "me.z += Parent.max_z + my.max_z;" lines. If you need it to do more, or it aint what you can use, let me know and I'll mod it accordingly. //
function CreateFloater( ENTITY* Parent, STRING* FloaterFilename )
{
if(Parent==NULL) return; //nothing to attach to
//
me = ent_create( FloaterFilename, Parent.x, NULL); //create Floater object
me.z += Parent.max_z + my.max_z; //position Floater roughly ABOVE Parent Collision Box Center
while(Parent!=NULL)
{
vec_set( me.x, Parent.x ); //These TWO lines are only needed to make Floater "follow"
me.z += Parent.max_z + my.max_z; // the Parent model if it is ever moving / moved
wait(1); //keep function alive as long as Parent exists
}
ptr_remove( me ); //automatically delete Floater once Parent no longer exists
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: How to create a keyword for each entity at runtime??
[Re: LavenderSs]
#225435
09/04/08 14:46
09/04/08 14:46
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
So is it usable as it stamds, that is, can you modify it to do exactly what you want? Or at least use it as a basis for writng your own?
No, Im not looking for credits on such a small snippet, I just want to know so I can disengage my brain from this task and move on to other things.
PS Feel free to PM me here if you need further help with this function.
Best of luck...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|