.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   PMB, SpawnPost for other entities? (http://forums.bots-united.com/showthread.php?t=1345)

stefanhendriks 12-04-2004 15:24

PMB, SpawnPost for other entities?
 
As you can read in the buttons thread, i have difficulties detecting a button in de_prodigy. It works with 1 button, but the other button does not get detected.

The tracehull:

Code:

UTIL_TraceHull (pBot->pEdict->v.origin, vPentVector, dont_ignore_monsters, point_hull, pBot->pEdict, &trb);
goes THROUGH the button, but returns "worldspawn" as hit entity. I guess there is something wrong with the button itself and perhaps something has to be changed in order to get it detected? I have for the moment:

Code:

int Spawn_Post (edict_t *pent)
{
  // solves the bots unable to see through certain types of glass bug.
  // MAPPERS: NEVER ALLOW A TRANSPARENT ENTITY TO WEAR THE FL_WORLDBRUSH FLAG !!!

  // is this a transparent entity ?
  if (pent->v.rendermode == kRenderTransTexture)
        pent->v.flags &= ~FL_WORLDBRUSH; // then clear the FL_WORLDBRUSH flag

  // is this a trigger_multiple ?
  if (strcmp(STRING(pent->v.classname), "trigger_multiple") == 0)
        pent->v.flags &= FL_WORLDBRUSH; // make it detectable!


RETURN_META_VALUE (MRES_IGNORED, 0);
}

but it does not work. This is just a random shot i took though. I am diggin into the doors, buttons and other cppfiles of the sdk, but no luck so far. Perhaps you can tell me what flag MUST be set in order to get detected by a traceline/hull?

stefanhendriks 12-04-2004 16:22

Re: PMB, SpawnPost for other entities?
 
Update:

i have tried several things, like changing into SOLID_BSP and the like. Nothing gives me the satisfied result.

I did not find anything that could help me further. I have set the worldbrush flag and such but it still gives me "wordspawn" when it hits the button. So, this leaves me to the following:

Could it be possible that the box of this trigger_multiple is so big, that the 'center' of it will be in a wall (worldspawn). Therefor the wall will be 'hit' and not the trigger multiple?

I have simply no other clue how to fix this.

edit: before anyone wants to 'fix' me on this:
i used the following code:
Code:

  // is this a trigger_multiple ?
  if (strcmp(STRING(pent->v.classname), "trigger_multiple") == 0)
  {
        pent->v.flags &= ~FL_WORLDBRUSH; // then clear the FL_WORLDBRUSH flag
        pent->v.flags |= FL_WORLDBRUSH;  // make it detectable!

        //pent->v.solid = SOLID_TRIGGER;
        //pent->v.solid = SOLID_BSP;
        SERVER_PRINT("Adjusted a trigger_multiple\n");
  }

as you can see, here i clear it, and then set it back to FL_WORLDBRUSH. I tried several combinations of this.

Pierre-Marie Baty 12-04-2004 19:35

Re: PMB, SpawnPost for other entities?
 
Perhaps the flags for trigger_multiples are set BEFORE they've been spawned... try doing this in Spawn() and not Spawn_Post() and see if it helps...

Does your trigger_multiple have a bounding box (v_absmin and v_absmax) ? I suppose yes. If it has none, then no wonder the TraceLine passes through.

*edit*
why are you clearing the bit and setting it again ?

stefanhendriks 12-04-2004 19:47

Re: PMB, SpawnPost for other entities?
 
I just tried several things just to see if something happens. Or to check if something actually _DID_ happen. I figured the spawn_post was effective when i used SOLID_BSP.

I don't know about v_absmin and v_absmax, but i assume it has some! You need vecbmodel() to get the vector , and thats the most centered one. It is undoable to know what the most closest vector of that model is towards the bot.

It worked with 1 button for de_prodigy okay, so i think its a mapping error. As you can see i already have fixed it, but its a very dirty fix.


All times are GMT +2. The time now is 13:58.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.