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 (TipmyPip, 1 invisible), 18,731 guests, and 7 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
Page 3 of 3 1 2 3
Re: Help for Adventure System [Re: Shadow969] #216648
07/18/08 03:41
07/18/08 03:41
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
If you design one struct to contain all the information an
"intelligent' entity needs you only need to use One of its
100 available skills to store a pointer to that struct.
The struct can contain all the Strings and descriptions you
could need.
Dumb entities (boxes, pickups can have a different struct in that
same skill slot that can store all the info IT need to decide if the
entity interacting with it is allowed to - and how.

For Example
Let SMARTY contains a single 'CHAR PlayerType;' which is unique
for each of your 'charactrs'. Lets call "Jason" is a type '1'.
Code:
typedef struct { 
   STRING* DisplayName;
   CHAR    PlayerType;
   ...
} SMARTY;

ENTITY* Jason;

void CreateJason()  
{
   Jason = ent_create("Jason.mdl", vector(0,0,0), NULL);
   SMARTY  JasonData;
   // Load Data from data files here maybe?
   JasonData.DisplayName = str_create("Jason VorHees");
   JasonData.PlayerType = "1";
   //
   // Store Struct in entity
   Jason.skill99 = JasonData;
}

Now we let DumbStruct contain a string of PlayerTypes that are allowed
to interact with this entity.
Code:
typedef struct { 
   STRING* ObjectDisplayName;
   STRING* AllowedPlayerTypes;
   ...
} BOXES;

ENTITY* TreasureBox[100};

void CreateTreasureBox( var Index )
{
   TreasureBox[Index] = ent_create("Chest.mdl", vector(0,0,0), NULL);
   BOXES  BoxData;
   // Load Data from data files here too maybe?
   BoxData.ObjectDisplayName = str_create("Rusty Iron Chest");
   BoxData.AllowedPlayerTypes = str_create("185Q");
   // THIS box allows types 1,8,5, and Q types in.
   //
   // Store Struct in entity
   TreasureBox[Index].skill99 = BoxData;
}



Do you see what I mean?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Help for Adventure System [Re: EvilSOB] #216850
07/19/08 06:31
07/19/08 06:31
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hi EvilSOB,

thanks for your answer.

This is exaclty what I've done already and it is working fine.

Currently I'm poring on how to fill the data of the structs.
You commented it with the lines "Load Data from data files here too maybe?" ...

Any idea what would be the best way? Loading the data from files???

Joozey said something about that I wouldn't need such files at all ...

Best regards,
Pegamode

Page 3 of 3 1 2 3

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