AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   some questions about converting engine to fm (https://forums.alliedmods.net/showthread.php?t=40959)

diamond-optic 07-06-2006 19:05

some questions about converting engine to fm
 
well ive started to convert a bunch of my plugins that use engine over to fakemeta.. which turned out to be a lot easier then i expected...

but as of right now theres a few problems ive ran into and cant figure out how to do the stuff thru FM...

like these two.. i have no idea what to do to make them work using fakemeta...

register_think("dod_smoke", "draw_smoke")
register_touch("dod_smoke", "*", "grenade_touch")

and then also:

VelocityByAim

.. i got velocity.. but i dont know how to do it depending on where you're aiming or whatnot...

and another one thats not a big deal.. just curious, is this one:

set_lights(light_variable)

**and also.. is it really worth converting over to fakemeta... i dont really mind the work of doing it.. but im not sure if theres really a big difference...

thanks for any help ahead of time :)

Zenith77 07-06-2006 19:14

Re: some questions about converting engine to fm
 
1. The FakeMeta module is actually a direct interface into a layer that amxmodx and its modules connect to as an interface to metamod, called fakemeta. This means your interacting directly with metamod and the hl engine. Plus, from my understanding, it uses less resources. ( I hope that section was right )

2. For your think/touch problems, register_forward() with FM_Think and FM_Touch constansts.

3. A VelocityByAim() function can be found in fakemeta_utils.inc(stickied). Or you could just manually do it.

4. For your light delima, engfunc() with the EngFunc_LightStyle constant I belive.

Orangutanz 07-06-2006 19:36

Re: some questions about converting engine to fm
 
velocity_by_aim was moved into AMXX 1.75+, see vector.inc

diamond-optic 07-06-2006 20:14

Re: some questions about converting engine to fm
 
ahh cool..

thanks alot.. didnt even realize the fm forwards lmao

there was another question or two i had.. but ill get this stuff straightened out first lol..

thanks again!

diamond-optic 07-07-2006 21:05

Re: some questions about converting engine to fm
 
ok another question regarding the forwards...

say thru engine this is what I had:

register_touch("dod_smoke", "*", "grenade_touch")

grenade_touch(grenid, object) { etc.....

...so with fakemeta i would do:

register_forward(FM_Touch, "grenade_touch")

but can i just leave:
grenade_touch(grenid, object)

as it is? or do i have to do something diff for the (grenid, object) part.. and like.. how can i figure out what else i can put there for different forwards and such... i have a feeling its gonna be a simple answer lol but i cant figure it out

**EDIT**

lol cuase im an idiot.. would this be the answer to my question:

http://www.amxmodx.org/funcwiki.php?go=func&id=1005

and so on for each forward im looking for... but registering FM_Touch instead of DF_Touch...?

VEN 07-08-2006 03:48

Re: some questions about converting engine to fm
 
DF_*'s and EF_*'s is just a wrappers for DLLFunc_*'s and EngFunc_*'s.
PHP Code:

stock DF_Touch(const ENT_Touched, const ENT_Other)
    return 
dllfunc(DLLFunc_TouchENT_TouchedENT_Other

I'd not recommend to use such wrappers.
But if you like short and simple wrapper idea, you can use Fakemeta Utilities which mostly uses macros which is better than such stock functions since macros processed on precompiling and never "called" as additional instruction.

As about you first question, you have to check for the classname inside touch function-handler. If you want an example, look into Real Nade Drops plugin.


All times are GMT -4. The time now is 08:08.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.