Raised This Month: $ Target: $400
 0% 

Works in Engine but not FM?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-13-2007 , 01:52   Works in Engine but not FM?
Reply With Quote #1

Why is it that the following works in the Engine module:

Code:
    new ent = create_entity("info_target");     entity_set_origin(ent, m_flOrigin);     entity_set_vector(ent, EV_VEC_angles, m_flAngles);     entity_set_string(ent,EV_SZ_classname,g_szFakeCorpse);     entity_set_model(ent, m_szModel);     entity_set_float(ent,EV_FL_framerate,1.0);     entity_set_int(ent, EV_INT_sequence, m_iSequence);

But when I convert it to FM, it does not work:

Code:
    new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );     engfunc( EngFunc_SetOrigin, m_flOrigin );     set_pev( ent, pev_angles, m_flAngles );     set_pev( ent, pev_classname, g_szFakeCorpse );     engfunc( EngFunc_SetModel, m_szModel );     set_pev( ent, pev_framerate, Float:1.0 );     set_pev( ent, pev_sequence, m_iSequence );

It simply does not show any entity in the world with FM. I've tried simple set_pev commands instead of SetOrigin and SetModel in the FM part...nothing.

The variables being used to set the entity variables are safe and sound as they work fine in engine. They are being retrieved from a message it's hooking (ClCorpse)

g_szFakeCorpse is a global entity, "fakecorpse"
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-13-2007 , 02:13   Re: Works in Engine but not FM?
Reply With Quote #2

I've tracked it down to the setting of the model. I've tried the following:

set_pev( ent, pev_model, m_szModel );
set_pev( ent, pev_model, engfunc( EngFunc_AllocString, m_szModel ) );

engfunc( EngFunc_SetModel, m_szModel );
engfunc( EngFunc_SetModel, engfunc( EngFunc_AllocString, m_szModel ) );

And still nothing. Basically the way I found it was by using FM for everything but the model - I did the model in engine like listed above and it worked. But I can't set the model in FM - any idea why?

Edit: Basically, this works:

Code:
    new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );     set_pev( ent, pev_angles, m_flAngles );     set_pev( ent, pev_classname, g_szFakeCorpse );     set_pev( ent, pev_framerate, Float:1.0 );     set_pev( ent, pev_sequence, m_iSequence );     set_pev( ent, pev_origin, m_flOrigin );     set_pev( ent, pev_nextthink, m_flNewSetting );     //set_pev( ent, pev_model, m_szModel );     //set_pev( ent, pev_model, engfunc( EngFunc_AllocString, m_szModel ) );     entity_set_model(ent, m_szModel);

But if I comment out the last line, the engine line, and use either of the FM line above it, it does not work. What's going on with this?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician

Last edited by Wilson [29th ID]; 01-13-2007 at 02:28.
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
stupok
Veteran Member
Join Date: Feb 2006
Old 01-13-2007 , 03:07   Re: Works in Engine but not FM?
Reply With Quote #3

Try this:
Code:
engfunc(EngFunc_SetModel, ent, "models/holo.mdl")
Taken from here.
stupok is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-13-2007 , 04:10   Re: Works in Engine but not FM?
Reply With Quote #4

It's because you don't specify which entity to set the model for.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-13-2007 , 20:50   Re: Works in Engine but not FM?
Reply With Quote #5

Perfect. How silly of me. Thank you, you sons of wisdom.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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