Jump to content

SetEntityCallback


Meldrion
 Share

Recommended Posts

Good evening.

I try to make simple collision Events ( when u hit the Invisible Trigger, a Sound starts to play etc) with Delphi 7.

Well the problem I have, is that when I hit my Trigger I get an AccessViolation. I know that this was reported as a Bug and Josh fixed it but still,

it is not working for me.

 

EntityType(MyController,1,1);

EntityType(CollisionBox,4,1);

Collisions(1,4,2);

SetEntityCallback(CollisionBox,@EntityCollisionCallback,ENTITYCALLBACK_COLLISION);

 

in my MainLoop i call this for testing:

MessageBox(CollisionInfo);

 

Here are some functions I made in order to make things easier for me:

 

procedure MessageBox(Text:string);

var Texture: TTexture;

begin

SetBlend( BLEND_ALPHA );

Texture := LoadTexture('abstract::textbox.dds');

DrawImage (Texture,10,10,600,120);

SetColor ( Vec4(255,255,255,255) );

DrawText(30,30,pChar(Text));

end;

 

procedure EntityCollisionCallback(entity0:TEntity;entity1:TEntity;position:Pointer;normal:Pointer;force:Pointer;speed:real );stdcall;

var VecPosition: TVec3;

begin

CollisionInfo:= GetEntityKey(entity0,'Name');

end;

 

 

Btw: The @T means the AdressOf(T) in Delphi

 

I hope someone can help me out, cause this is about to drive me crazy.

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...