Page 1 of 1
Collision entity's
Posted: Mon Mar 31, 2008 5:10 pm
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
Posted: Mon Mar 31, 2008 6:15 pm
by jv_map
Use:
local.dude collisionent $halftrack_mask
Where local.dude is your halftrack.
Posted: Mon Mar 31, 2008 6:45 pm
by Bromi
Thanks a lot i had been trying different things for over an hour
so happy right now!!!!
Posted: Mon Mar 31, 2008 7:12 pm
by ViPER
question - can the Collision mask/bounding box be scripted serverside?
Posted: Mon Mar 31, 2008 7:19 pm
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.
Posted: Mon Mar 31, 2008 7:45 pm
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
Posted: Mon Mar 31, 2008 9:06 pm
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...
Posted: Mon Mar 31, 2008 9:32 pm
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
Posted: Tue Apr 01, 2008 4:22 pm
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.
Posted: Tue Apr 01, 2008 5:42 pm
by ViPER
Thanks
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 ?
Posted: Tue Apr 01, 2008 6:20 pm
by jv_map
Nothing can be damaged by terrain

At least not in mohaa.
Not even by an earthquake
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!
Posted: Tue Apr 01, 2008 7:10 pm
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.