Jump to content

lua message dispatcher for entity.userdata


flachdrache
 Share

Recommended Posts

Moin,

i like to have all "fire an forget" effects handled client side alone e.g. decalTime and other time based effects.

 

So far i think following objects would be needed

a global timer
message dispatcher
eventSystem

 

basically the idea is to set entity keys on new effects ( like a decal ). Like ... spawn decal, set timer, if decalTime over send message to free itself. I want to solve that in the OOP way but iam somewhat puzzled where to start ?! How do i collect / record new entitys added to the world from given moment ?

 

any help appreciated

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Assuming you made some kind of EntityFactory script in Lua, and just hooked in the base.lua entity:Spawn function to log in your factory that an entity was created you could do that. Assuming you are going for an all Lua approach.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Hey Tyler - in fact my assumptions are partially based on some of the lua classes you posted.

This event message dispatcher might work in the lua world alone, setting postprocessing fx and other client behavior might be controlled in source code.

 

However, if the player steps on the firepit i dont see a reason why it shouldnt controll timing a fire emitter and such.

 

I basicall want to put a timer entity in the scene which counts the seconds the game is running and if a behavior is at hand ( a new decal is spawned ) the message dispatcher class notes the event system that it should free this decal in 15 seconds ... how do i collect those data ?

 

 

PS:

The non-OO approach would be to "simply" have the entity send a message to itself - which free`s itself after a delay.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

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...