Collision entity's

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Bromi
Lance Corporal
Posts: 24
Joined: Sun Dec 23, 2007 2:09 pm

Collision entity's

Post by Bromi »

ok i have created a script that spawns a halftrack sets it up with 2 passengers and a turret gunner and then drives to where i want it i have copied the "halftrack_mask" from the spearhead tutorials i then want to have it attached to the halftrack

i used this line of code

Code: Select all

local.dude.target = $halftrack_mask
local.dude is the newly spawned halftrack (i edited the spawner.scr)

now my problem the mask is attached to the halftrack but not in the correct place it is too low.

im not to bothered about the surface effects of the entity but the gunner cannot shoot unless there is a collision mask in the right place

also i have tried this without spawning a halftrack and just adding it in radiant and it worked fine im rather confused

thanks
bromi
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Use:

local.dude collisionent $halftrack_mask

Where local.dude is your halftrack.
Image
Bromi
Lance Corporal
Posts: 24
Joined: Sun Dec 23, 2007 2:09 pm

Post by Bromi »

Thanks a lot i had been trying different things for over an hour :D

so happy right now!!!!
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

question - can the Collision mask/bounding box be scripted serverside?
Bromi
Lance Corporal
Posts: 24
Joined: Sun Dec 23, 2007 2:09 pm

Post by Bromi »

i think so i am no expert on scripting this is more of a guess but if you were to spawn the brushes and script origin group them and give them the targetname and the correct texture. although they would be some complex brushes to spawn i think.
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

i do not have the SH sdk - what is the correct texture? if possble to script this an example would be appreciated.

THX
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

You cannot spawn brushes (exception: cloning existing brushes in the same bsp) so the server-side collision mask is generally a no-go...
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

jv_map wrote:You cannot spawn brushes (exception: cloning existing brushes in the same bsp) so the server-side collision mask is generally a no-go...
hmmm. a solid script model could not be assigned whatever attributes to make it a collision?

Code: Select all

	local.brush = spawn script_object targetname tank1_mask
	local.brush.origin = $tank1.origin 
	local.brush setsize ( -40 -40 40 ) ( 40 40 100 )
	local.brush solid
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

That will only give it a solid bounding box that will always have an identity rotation matrix (i.e. just cannot be rotated). The advantages of a collisionent is that you can make much more complex shapes and have them rotate properly with the ent. But, as jv pointed out, you can only make them in Radiant.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Thanks :D

I would be happy with a solid bounding box for serverside work around.

How do I make this bounding box vulnerable to tank projectile and yet immune to terrain? spawnflags ?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Nothing can be damaged by terrain :? At least not in mohaa.

Not even by an earthquake :P

Making your server-side tank damageable couldn't be easier:
$tank takedamage

:)

However, there is a at least one bug in mohaa. You will need the line
$tank immune bash

Otherwise players can crash your server by bashing the tank!
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

takedamage isn't working here - the tank is not solid when player gets in. if solid, the tank is locked to the terrain.

so projectiles go right through otherwise - this is why I would like to script a bounding box.
Post Reply