Raised This Month: $ Target: $400
 0% 

Model collision with world


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sgtbane
Member
Join Date: Feb 2006
Old 07-02-2007 , 19:49   Model collision with world
Reply With Quote #1

I cant get collisions to work properly with my created entity.

Code:
public makeapc(id) 
{
	new Float:origin[3]
	pev(id, pev_origin, origin)
	new apc = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
	if(!apc) 
	{
		client_print(id,print_chat,"Error: APC WAS not created.")
		return PLUGIN_HANDLED
	}
	client_print(id, print_chat, "APC: %i", apc)
	set_pev(apc, pev_classname, "item_apc")
	dllfunc(DLLFunc_Spawn, apc)
	
	new Float:angles[3] = {0.0, 0.0, 0.0}
	new Float:fmins[3] = {-80.0, -80.0, -90.0}
	new Float:fmaxs[3] = {80.0, 80.0, 0.0}
	
	engfunc(EngFunc_SetModel, apc, "models/banes/APC03.mdl")
	origin[2] += 90
	engfunc(EngFunc_SetOrigin, apc, origin)
	engfunc(EngFunc_SetSize, apc, mins, maxs)
	
	set_pev(apc, pev_angles, angles)
	set_pev(apc, pev_takedamage, 1.0)
	set_pev(apc, pev_health, 500.0)
	set_pev(apc, pev_movetype, MOVETYPE_PUSHSTEP)
	set_pev(apc, pev_solid, 2)
	
	set_pev(apc, pev_nextthink, get_gametime() + 0.01)
	dllfunc(DLLFunc_Think, apc)
	return PLUGIN_HANDLED
}
The bounding box doesen't seem to want to collide with all walls. It will collide with players, but when driving into walls, the maxs half of the box just go right through the walls.
Ignore the z axis box. It extends below since the center bone of the model is in the center-top of the model so that when attaching a camera you can view above it.

I am trying to make a driveable vehicle that will be able to hold multiple people, where you simply walk up to it, press your key, instead of the crappy cars built into cs.
I am doing this for the possibility of:
vehicles that take damage, mobile mounted weapons, and hopefully better physics then the default 1.6 ones.

any help with the collisions would be aprecieated.
Thanks.
__________________
[Add|Community]

~SgtBane
sgtbane is offline
Send a message via MSN to sgtbane
sgtbane
Member
Join Date: Feb 2006
Old 12-12-2008 , 19:55   Re: Model collision with world
Reply With Quote #2

Bump? o.0

I never got a response to this and am still having problems with this type of thing. When I set the bounding box of something, the 'maxs' half of it is totaly ignored as if it assumes them to be 0. If anyone has a solution to this it would be greatly appreciated.

new Float:mins[3] = {-50.0, -50.0, -50.0}
new Float:maxs[3] = {50.0, 50.0, 50.0}
engfunc(EngFunc_SetSize, entid, mins, maxs)

The bounding box appears to be the proper size when running around the entity, since you can collide with the bounding box as a player in the places that you should. yet when you try to move the entity with velocity, it will only collide on the 'mins' half of the bounding box and assume the 'maxs' is 0,0,0
__________________
[Add|Community]

~SgtBane
sgtbane is offline
Send a message via MSN to sgtbane
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 12-13-2008 , 00:52   Re: Model collision with world
Reply With Quote #3

Have you tried SOLID_BSP?
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
stupok
Veteran Member
Join Date: Feb 2006
Old 12-15-2008 , 13:27   Re: Model collision with world
Reply With Quote #4

I haven't played with this myself yet, but what happens if you put dllfunc(DLLFunc_Spawn, apc) at the end rather than before setting size, origin, and other properties?

Also, try looking for a plugin that does something similar. That's probably the fastest way to figure out how to do it properly. I don't have any plugins in mind right now, sorry.
__________________
stupok is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-15-2008 , 13:51   Re: Model collision with world
Reply With Quote #5

Set pev_solid before the entity size (you shouldn't have to spawn it).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 21:29.


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