![]() |
hacking monster_plugin
ok so I guess I just dont get it...
I've decided I'd like to change monster_plugin in a way that allows for team based monsters. To just test things for now I've changed barney to be assigned to v.team = 1. This works, I see his v.team assignment when I query using pmtools... so next step is to hack monsters.cpp in the BestVisibleEnemy() function to ignore players on same team as the monsters v.team right? ok so here is a my modified chunk of that function... Code:
edict_t *CMBaseMonster :: BestVisibleEnemy ( void ) btw that testing console output does work... *** MONSTER TEAM IS 1 *** MONSTER'S ENEMY TEAM IS 2 right now I have barneys team statically set to 1... I see no errors before crash, I dont even get that MONSTER TEAM IS part before crash unless I comment the if statement I added... I dont get it. pulling out hair here and know its something simple/stupid |
Re: hacking monster_plugin
oh and server dont crash if I dont spawn any barneys if that helps...
|
Re: hacking monster_plugin
did you check if pev or pEnt is NULL?
[edit] or maybe a memory error from somewhere else... [/edit] |
Re: hacking monster_plugin
first off keep in mind that I am a php dev and a newbie C hacker...
but printf("*** MONSTER TEAM IS %i\n",pev->team); printf("*** MONSTER'S ENEMY TEAM IS %i\n",pEnt->v.team); these return data... |
Re: hacking monster_plugin
comment out the part of the code that is causing the crashing and see if it still crashes..
|
Re: hacking monster_plugin
yeah did that. see code in first post? If I comment out the if statement all is fine... or if I dont comment it and dont spawn any barneys its fine so I know its that if statement...
// lets see if this monster shares same team as player if team based mod... if ( ( pev->team != pEnt->v.team ) || ( pEnt->v.team == 0 ) ) { |
Re: hacking monster_plugin
weird... this code is NOT crashing...
Code:
if ( UTIL_IsPlayer(pEnt) ) |
Re: hacking monster_plugin
i am not entirely sure why it crashes, though something tells me that somehow the information you try to print is not initialized properly.
Try this, first try to output the first sentence, but comment out the second one. Then try the second one only and comment out the first one. DO NOT change team data or whatever, simply try to print out the data. If that crashes, it means the data is not initialized. Make sure it IS. The piece of code in the latest post does a check on this data, thats why it is probably not crashing. Though i wonder if it works like you want it to work? |
Re: hacking monster_plugin
shouldn't that be
Code:
printf("*** MONSTER TEAM IS %d\n",pev->team); |
Re: hacking monster_plugin
I was under the impression that d and i are both int, but none the less that portion of the test code is working correctly...
|
Re: hacking monster_plugin
nm took a diff approach and have something working now
|
Re: hacking monster_plugin
Hello
not sure if this is where I go, I`d like to get the monsters to be TEAM SPECIFIC I had the "plugin_blatt_monsters3.5" in my listen server & could use "targetteam/1" or "targetteam/2" & they would only attack enemy team.Then I seen that "monster_plug_expension_1.2" and put that in.{I really like the monsters in that} but I can`t do the specific team thing,is there a way to do it? have the newest AdminMod Metamod v1.17.3 monster v3.00.00 chickenmod-1.0.5.1 stripper2 v1.00.00 FoxBot v698 WinXP home with service pk2 Play TFC. If anyone could help me I`d appreciate it. If I have to I will go back to the 3.5 as a last resort. Thank you, Mack |
Re: hacking monster_plugin
see this:
http://forums.bots-united.com/showth...monster+plugin Best I can do for ya, I've not worked on monster plugin in ages and probably wont be doing any future work either. You might do a little more searchin round too as someone could have ran with that project since I made that post back in 2004. |
Re: hacking monster_plugin
OK,
Thanks for the reply, I will see if I can hunt anything else up I can always go back to the 3.5, but haven`t decided yet THANKS AGAIN. Mack:detective: |
Re: hacking monster_plugin
anyone know what is needed to compile monster plugin ?
ive tried vc++ 2005 + psdk and ive got this: Code:
[small] Code:
VoivoDian@VOIVOD /d/work/compile/mingw/proj/monster_plugin/monster_plugin/dlls |
Re: hacking monster_plugin
for the VC 2005...:
On all errors such as: Code:
c:\documents and settings\voivodian\moje dokumenty\visual studio 2005\projects\monster_plugin\dlls\apache.cpp(949) : error C3867: 'CMApacheHVR::AccelerateThink': function call missing argument list; use '&CMApacheHVR::AccelerateThink' to create a pointer to member Code:
SetThink( AccelerateThink ); Code:
SetThink( CApache::AccelerateThink ); but don't forget to change CApache to the class name this functions called from... |
Re: hacking monster_plugin
THX, i will try this, hope im not going to make bigger mess in the code :p do i should enable optimizations in vs++ 2005?
|
Re: hacking monster_plugin
still got this :(
Code:
Compiling... |
Re: hacking monster_plugin
first goto extdll.h
and after ifndef/defined, add code Code:
#pragma warning (disable : 4996) Code:
c:\documents and settings\voivodian\moje dokumenty\visual studio 2005\projects\monster_plugin\dlls\animation.cpp(331) : error C2065: 'i' : undeclared identifier Code:
for (int i = 0; i < gpGlobals->maxClients; i++) Code:
c:\documents and settings\voivodian\moje dokumenty\visual studio 2005\projects\monster_plugin\dlls\apache.cpp(139) : error C3867: 'CMApache::DyingThink': function call missing argument list; use '&CMApache::DyingThink' to create a pointer to member Code:
from |
Re: hacking monster_plugin
can you give me the finished version of the plugin when you guys are done?
|
Re: hacking monster_plugin
k, will try this later, couse now im drunk like hell :D
|
Re: hacking monster_plugin
thx strelomet, going to mess with the code laterz
|
All times are GMT +2. The time now is 03:50. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.