Raised This Month: $51 Target: $400
 12% 

Solved [H3LP] First Spawn


Post New Thread Reply   
 
Thread Tools Display Modes
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-25-2017 , 17:56   Re: [H3LP] First Spawn
Reply With Quote #11

Quote:
Originally Posted by PRoSToTeM@ View Post
I meant ham hook.
It doesn't work, I have another method that works fine, but I wanted to use spawn.

PHP Code:
new ent = -1
BreakableSpawn
(ent); 
And after that goes the code on BreakableSpawn and it works just fine, but I prefered to use Ham or Orpheu, but since Orpheu was already included it was good to use it rather than including more incs.
DarthMan is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 04-25-2017 , 18:12   Re: [H3LP] First Spawn
Reply With Quote #12

Can you show BreakableSpawn code?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 04-25-2017 , 18:48   Re: [H3LP] First Spawn
Reply With Quote #13

Ops
__________________

Last edited by abdobiskra; 04-26-2017 at 03:42. Reason: i dont read all
abdobiskra is offline
Send a message via Skype™ to abdobiskra
SpannerSpammer
Member
Join Date: Mar 2006
Old 04-26-2017 , 00:40   Re: [H3LP] First Spawn
Reply With Quote #14

^^ You don't need Orpheu for this. If you look up the entity's spawn
code in the HL SDK first, it will give you clues as to what functions are called
when this entity is spawned. Ther are two simple ways (without orpheu):

1. Almost all entities in Half-Life call SetModel() from the spawn function.
Hook SetModel, look for the func_breakable classname, then get the
health of the object and set max health.
OR
2. Hook KeyValue(), look for the func_breakable classname,
look for the health key and get it's value and set max health.
(the default health set for this entity in the FGD is 1 hp).
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-26-2017 , 03:52   Re: [H3LP] First Spawn
Reply With Quote #15

Quote:
Originally Posted by SpannerSpammer View Post
^^ You don't need Orpheu for this. If you look up the entity's spawn
code in the HL SDK first, it will give you clues as to what functions are called
when this entity is spawned. Ther are two simple ways (without orpheu):

1. Almost all entities in Half-Life call SetModel() from the spawn function.
Hook SetModel, look for the func_breakable classname, then get the
health of the object and set max health.
OR
2. Hook KeyValue(), look for the func_breakable classname,
look for the health key and get it's value and set max health.
(the default health set for this entity in the FGD is 1 hp).
None of the above methods are working, but they do work on respawn. i beleive that the map entities are executed before any plug-in is loaded.
DarthMan is offline
SpannerSpammer
Member
Join Date: Mar 2006
Old 04-28-2017 , 18:30   Re: [H3LP] First Spawn
Reply With Quote #16

The KeyValue method works, I tested it myself:
Spoiler


The SetModel() method (pre or post hooks), on the other hand, DOES NOT work
in AMX for map entities, only dynamically created in-game entities. This seems
to be yet another bug in AMX because I was able to hook this function easily
with a MetaMod plugin for all types of entities.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-29-2017 , 02:40   Re: [H3LP] First Spawn
Reply With Quote #17

Quote:
Originally Posted by SpannerSpammer View Post
The KeyValue method works, I tested it myself:
Spoiler


The SetModel() method (pre or post hooks), on the other hand, DOES NOT work
in AMX for map entities, only dynamically created in-game entities. This seems
to be yet another bug in AMX because I was able to hook this function easily
with a MetaMod plugin for all types of entities.
Ah, but you have used pfn_keyvalue, I tried it other way.
Anyways, I used Spawn on plugin_precache and that seemed to fix it.
DarthMan is offline
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 00:26.


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