Page 1 of 2

Collision entities

Posted: Fri Apr 11, 2003 2:57 pm
by HUNTER--{A}--
I am having a problem getting a collision mask to follow my truck in the map I believe I am not setting up the setcollisionentity properly.

Posted: Fri Apr 11, 2003 3:28 pm
by HkySk8r187
just make a new map, put in the model you want to have the collmap, put the model at the default angles and put the models origin at 0,0,0. Make your clip brushes however you want them, and save the map file with the same name as the model. Save it to the location with the rest of the collmaps of that type and everytime you use that model you'll have a collmap from that file. You wont need to change any settings or tell it to work, it automatically searches for the .map file that matches the model name and loads the collisions from it. Good luck.

Posted: Fri Apr 11, 2003 3:33 pm
by mohaa_rox
Yes, maybe also try:

$truck.collisionent = $truck.target

Sets the collision mask. Only works for driveable vehicles, but hey! WHo knows? No harm trying?

Posted: Fri Apr 11, 2003 4:14 pm
by jv_map
mohaa_rox wrote:Yes, maybe also try:

$truck.collisionent = $truck.target

Sets the collision mask. Only works for driveable vehicles, but hey! WHo knows? No harm trying?
I think he meant for a driving vehicle also :). Make sure to target the truck to the collision ent though: first select the truck, then the collision mask and press ctrl + k.

Posted: Sat Apr 12, 2003 6:29 am
by HkySk8r187
Why do it that way? Then you have to make the collision brushes for each model you use and each map, just make a seperate map file for it and you're done, forever, everytime you use and model and in every map, and it doesn't need to be included in your pak, just make a collmap like 2015 did when they developed the game!

Posted: Sat Apr 12, 2003 8:09 am
by jv_map
HkySk8r187 wrote:Why do it that way? Then you have to make the collision brushes for each model you use and each map, just make a seperate map file for it and you're done, forever, everytime you use and model and in every map, and it doesn't need to be included in your pak, just make a collmap like 2015 did when they developed the game!
That will only work for static models :?

Posted: Sat Apr 12, 2003 5:31 pm
by HkySk8r187
Yes that's correct. I think thats what he was trying to do though.

Posted: Sat Apr 12, 2003 7:22 pm
by HUNTER--{A}--
It is for a truck that is following a oath around the map. I have made a clip that covers the truck the way I want (with an extension that makes it twice the hieght due to the following of the z axis). I have selected all the brushes in the clip and have made them a script object and have entered a value of targetname gtruckmask. The truck that I have that goes around the map is targetname gtruck I have also entred the following value on the truck Target gtruckmask. There is a line that connects the two together.
Is there anything else that I need to do in the map?

In the script I have entered the following: (this is where I believe my problem lies)

main:

exec global/ai.scr

exec global/exploder.scr

level waittill prespawn

exec global/thedock_precache.scr
level.script = maps/obj/thedock.scr
exec global/ambient.scr thedock
exec global/door_locked.scr::lock

setcvar "g_obj_alliedtext1" "Destroy the E-boat"
setcvar "g_obj_alliedtext2" "Destroy the Flak88"
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" " Prevent Allies from"
setcvar "g_obj_axistext2" "destroying the boat"
setcvar "g_obj_axistext3" "and the Flak88"

setcvar "g_scoreboardpic" "Thedock"

thread fifisetup

thread random_explode_setup


level waittill spawn


level.bomb_damage = 300
level.bomb_explosion_radius = 1500
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 2
level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 10 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

$gtruck thread drive_like_crazy $gtruck1

// level waittill roundstart

$gun_bomb thread global/obj_dm.scr::bomb_thinker
$flak88_explosive2 thread global/obj_dm.scr::bomb_thinker

$gtruck.collisionent = $gtruck.target
thread axis_win_timer $gun_bomb $flak88_explosive2
thread allies_win_bomb

end

drive_like_crazy local.path:
while(self)
{
self drive local.path 290 100 45 128
waitframe
self waittill drive
}
end




end




//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end



//*** --------------------------------------------
//*** "Allies Victory"
//*** --------------------------------------------

allies_win_bomb:

while(level.targets_destroyed < 1)
waitframe

level.dmrespawning = 0
iprintlnbold "Allies destroyed a Target! Respawn has been disabled!"

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies
end

I have left out the scripting for the random explosions and the attack dog that follow the above.
This map has 2 objectives 1. Blow up the flak88 2. Blow up the three guns on the e-boat. It has resawn until one of the objectives is complete. There is a truck that drives through the map. There is an attack dog that respawns to one of three different places. I want the collision mask to follow the truck.

Posted: Sun Apr 13, 2003 7:55 am
by jv_map
Script looks ok. Any errors in console?

Posted: Sun Apr 13, 2003 1:32 pm
by HUNTER--{A}--
Do I have all the values entered that I need in the 2 script objects? Is there a set value that needs to go in one of them? Is the "$gtruck.collisionent = $gtruck.target" entered at the correct point in the script file?

Posted: Sun Apr 13, 2003 1:39 pm
by jv_map
Maybe you have to set the collisionent before the truck starts to drive? Not sure :?.

Are you sure the script runs at all?

Posted: Sun Apr 13, 2003 2:28 pm
by HUNTER--{A}--
I found the following error in console:

$truck.collisionent = $truck.target (maps/obj/thedock.scr,54)
$truck.collisionent = $truck^

script error: field 'target' applied to NULL listener

Posted: Sun Apr 13, 2003 2:49 pm
by jv_map
Hmm. That means that there is no entity with targetname 'truck'. Check the targetnames in your map versus your script.

Posted: Mon Apr 14, 2003 2:34 am
by HUNTER--{A}--
The entity is called gtruck. That's the way I called it in the script (see above posting) as well.

Bind

Posted: Mon Apr 14, 2003 3:10 am
by tltrude
If it is a script_object you can bind it to the truck:

level waittill prespawn

$gtruckmask bind $qtruck

It will stick to the truck like glue and you wont need all that collisionent stuff.