Posted By: Ruben
Non-Passable Bounding Box Needed - 10/24/17 02:26
I am trying to make the bounding box (manually set collision hull) surrounding an NPC to not allow the player to enter the bounding box. I successfully created a bounding box, as I can tell by pressing the F11 key twice and seeing it. However, the player is continually able to pass into the NPC's bounding box when I do not want it to.
I thought I knew how to do this in the past, but it has been awhile since I have done it, and I forgot. I thought I did everything I needed to do to make the bounding box non-passable, as follows:
I tried setting c_setminmax() before manually creating the bounding box. I also set the push value of the NPC to the same push value as the player. The model of the NPC itself is creating collision (Un-passable), but not the bounding box surrounding the NPC. I tried getting rid of c_setminmax(), but the same thing happens.
Any advice would be greatly appreciated in helping me to make the collision hull un-passable. Thank you.
I thought I knew how to do this in the past, but it has been awhile since I have done it, and I forgot. I thought I did everything I needed to do to make the bounding box non-passable, as follows:
Code:
function playerAdvance() { c_move(me, move_vec, vector(0, 0, my.GRAVITY_VAR), USE_POLYGON | IGNORE_PASSABLE | IGNORE_PUSH | GLIDE); } action player_function() { ... player = me; my.push = 10; ... my.eflags |= FAT | NARROW; ... c_setminmax(me); set(my, POLYGON); ... while (player_health > 0) { ... playerAdvance(); ... wait(1); } ... } action villain_action() { ... my.eflags |= FAT | NARROW; ... villain = me; ... my.push = 10; set(my, POLYGON); ... while (my.status != villain_dead) { ... wait(1); } ... } void createVillain() { villain = ent_create("villain.mdl", vector(-64,146,-111), villain_action ); ... c_setminmax(villain); // set bounding box to individual values vec_set(villain.min_x,vector(30,20,80)); vec_set(villain.max_x,vector(-20,-20,0)); } function newGameButton() { ... level_load ("gameWorld.wmb"); ... hero = ent_create ( "player.mdl", vector(8,-606,-111), player_function ); ... }
I tried setting c_setminmax() before manually creating the bounding box. I also set the push value of the NPC to the same push value as the player. The model of the NPC itself is creating collision (Un-passable), but not the bounding box surrounding the NPC. I tried getting rid of c_setminmax(), but the same thing happens.
Any advice would be greatly appreciated in helping me to make the collision hull un-passable. Thank you.