I just began looking into tutorials of esenthel and i really like the clean structure and well given examples.
If anyone is already deeper inside Coding/Handling,
how much effort/coding is involved for a interaction where the player can
1. Drop 1st Pillar-Object
1. Drop 2nd Pillar-Object
2. If the distance between Pillar-Objects isnt too far, a kind of Trigger-Line is created between those objects.
3. If an npc crosses the Trigger-line, some event is triggered.
Asking because i am aiming at a multiplayer game, where the known rpg interactions (talk to npc, hit skill button, open door) are moved to a more interactive level. or better, i dont dream of creating a big world full of repeating quests/npc/items, but more of some tiny "arcade" like elements, that give "fun"/"creativity" in exploring the world.
I finally worked through several of the tutorials.
But i somehow cant attach a Custom Parameter to a dynamical created Object. Am I doing sth wrong here?
The item seems to be created correctly into the extended class (Item, GAME::Item). But i cant set/initialize the custom parameters.
Quote:...
STRUCT(Item , Game::Item) // extend items to include item Icons, and parameters
//{
Str name;
Byte type;
Flt power;
// manage
void create(Game::ObjParams &obj);
Item();
};
Game::Obj *newObj = Game::World.objCreateNear(objs,Matrix(objs.scale(),T.pos()));
...
...
...
if(Physics.sweep(ball,tpos, &phys_hit2)) // test for obstacles in 1 meter range, test door actor groups only
{
if(Door *door=CAST(Door, phys_hit2.obj)) // if it's a door
{ D.text(0, 0.7f, S+"IS DOOR "+ door->type() );
D.text(0, 0.6f, S+"Obj TYpe: " + door->type()) ;
door->open(); // automatically open the door
}
Just going to say I don't think that you need to set the actor.group if you are using standard enum identifiers in the editor, unless overloading with custom type.
I think "find" and "get" param is case sensitive?
I also think
if(Param *par=obj.findParam("name" ))name =par->asText(); can be reduced to
name = obj.findParam("")->asText();
(This post was last modified: 03-13-2012 04:17 AM by Zervox.)
With a lot of testing and rewriting, i finally got a working example.
Dynamic Object Creation, with a String, a Integer, a Float Variables.
But the Object Itself can be loaded from a obj file.
You wouldnt believe that the String Handling took me some hours.
Its different from numeric Values Handling.