Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 622 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
grouping entities #122390
04/08/07 16:45
04/08/07 16:45
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Here's a challenge to all you wonderful ingenius code wizards that give us
klutzy wannabee coders your time and solutions.

I'm sure there's no quick and easy way to do this, but I can't resist asking.

If I would like a group of entities to be created in an existing level by code,
say a village with trees and people (shades of Brigadoon),
is there a shortcut for the process?
You know, like creating the group in WED as a prefab
and then using ent_create to make it happen.

I know I can do this with ent_create for each model but I'm looking
for a way to repeat the process, as a group, in various random locations
without having to figure the vector for each model every time.

The manual is pretty sketchy on prefabs
and I couldn't find any help there.

A penny for your thoughts.

Re: grouping entities [Re: JazzDude] #122391
04/08/07 18:07
04/08/07 18:07
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
well the problem with prefabs is that you cannot store models in side of it, as far as I know.

One solution:
Create the village in MED by "merging" the different models, but this may screw up your UV mapping/skinning

Another solution which is a bit more difficult (maybe):
Create the village in WED and define one model as "center" of the village.
Then you have to calculate the relativ position of the other models to that "center-model".
Best thing: write it down somewhere

Next is: creating one function which creates the whole village, based upon thoses relativ positions.
You can customize that function by passing two values as the x and y coordinates where the village should be created.
You could find out the z-coordinate with some tracing.

Do you need a specific code example or is that little "idea-explanation" enough?

Re: grouping entities [Re: Xarthor] #122392
04/08/07 23:15
04/08/07 23:15
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
It sounds like a time saver idea. And your explanation is probably enough to get me thru it. Thanks a bunch!

Wasn't your signature revoked for lack of funding? Or violated some environmental laws?

Re: grouping entities [Re: JazzDude] #122393
04/09/07 12:12
04/09/07 12:12
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline
User
sheefo  Offline
User

Joined: Jul 2006
Posts: 783
London, UK
I had a way of grouping units in my RTS, which is incomplete.

You can create a 2D array of handles, MAX_NUMBER_OF_GROUPS x MAX_NUMBER_OF_ENTITIES. Then you make a skill holding it's group number and it's index in that group.
It works for me, but I haven't gotten round to manipulating these groups when you remove an entity from it and other stuff like that.

I hope that is what you wanted. If you want to see the code I can show you mine (in Lite-C).


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

Gamestudio download | chip programmers | 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