Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 12,420 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to create a keyword for each entity at runtime?? #225216
09/03/08 11:08
09/03/08 11:08
Joined: Nov 2007
Posts: 37
L
LavenderSs Offline OP
Newbie
LavenderSs  Offline OP
Newbie
L

Joined: Nov 2007
Posts: 37
Hi, guys.
I've been involved in a problem about my project recently. There are some human models in my scene and they are created by the same MDL file. I want to add something on or near their bodies to specify them such as A,B,C... There are some solutions in my mind, that are:
1) use some PCX files, each pics show one letter(have to put it in a proper position in advance in WED);
2) use the letters in the Prefab of WED (more wonderful effect,however it occupies more memories)
3) use MDL or something like that.
Moreover, it's better that these letters could be added at runtime in lite-c script(rather than put them one by one in WED). For example, there could write some code in script that initials and places the letters for all persons just after the command of WMB loaded(level_load("**.wmb")).
Do anyone have some ideas about this? Please say out if not understand what I mean. Thanks so much!!!

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 Offline
Expert
EvilSOB  Offline
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: EvilSOB] #225242
09/03/08 14:59
09/03/08 14:59
Joined: Nov 2007
Posts: 37
L
LavenderSs Offline OP
Newbie
LavenderSs  Offline OP
Newbie
L

Joined: Nov 2007
Posts: 37
Well, I just want it to be like this:
1)there're 6-7 persons.

2)all have Actions, but I'm not very sure if they have to be attached to the same Action..

3)yes, but I just want to operate them and set the skill(if needed) in the script.

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 Offline
Expert
EvilSOB  Offline
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.

Code:
//
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: EvilSOB] #225429
09/04/08 14:29
09/04/08 14:29
Joined: Nov 2007
Posts: 37
L
LavenderSs Offline OP
Newbie
LavenderSs  Offline OP
Newbie
L

Joined: Nov 2007
Posts: 37
Thanks, EvilSOB! Appreciate ur help so much!

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 Offline
Expert
EvilSOB  Offline
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
Re: How to create a keyword for each entity at runtime?? [Re: EvilSOB] #225626
09/05/08 12:35
09/05/08 12:35
Joined: Nov 2007
Posts: 37
L
LavenderSs Offline OP
Newbie
LavenderSs  Offline OP
Newbie
L

Joined: Nov 2007
Posts: 37
The issue is just one part of project, and your solution has been a great help to me. I'm just focusing on some other part besides this matter. So if there r any problem later on, I'll get in touch with you. Thanks again:)!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1