Page 1 of 1
driving truck
Posted: Wed Jun 03, 2009 4:08 pm
by dietje_schietje
When i add in my map a driving truck i have a problem i can walk trought it. only not where there is a brush from script object that the truck is targeting. I found this in the original maps the script object so i maked it to.
my script file:
main:
exec global/ai.scr
exec global/loadout.scr maps/test_drivingtruck.scr
level waittill prespawn
level waittill spawn
level.script = "maps test_drivingtruck.scr"
thread drive
end
drive:
$opel1 setcollisionentity $opel1.target
$opel1.origin = $opel1start.origin
$opel1 show
exec global/spotlight.scr::corona $opel1 "light left"
exec global/spotlight.scr::corona $opel1 "light right"
$opel1 thread global/vehicles_thinkers.scr::enemy_truck_think 400 6 $opel1path
end
Posted: Wed Jun 03, 2009 6:44 pm
by SilentAngel
what's $opel1 is?!

Posted: Wed Jun 03, 2009 6:59 pm
by dietje_schietje
opel1 = the truck
opel1.target = what opel1 is targeting in this case the script object
opel1start.origin = where the truck will teleportate to
opel1path = the first info_vehicle point
Posted: Thu Jun 04, 2009 11:23 am
by SilentAngel
well I already know that targetname are declared like this:
local.opel1.targetname = opel1
or
local.opel1 targetname opel1
so, even if I don't understeand what you are trying to do, I see that you didn't declare the target of $ operator...

Posted: Thu Jun 04, 2009 4:55 pm
by dietje_schietje
i want when my truck drive i can't walk trough it, i tried some things but always i can walk trough it but not in the middle area. The place where i can't walk trough is where in radiant the blue box from the truck. The script object is something i tried from the original maps but it don't works.
Posted: Thu Jun 04, 2009 5:45 pm
by SilentAngel
well, If I understood, that's all you need:
Also you MUST have declared the tergetname before that!
remember to do it if it's already not declared!
you should be able do do that with rediant too..but I don't know how..I'm not a mapper, just a scripter! lol
Posted: Thu Jun 04, 2009 6:01 pm
by dietje_schietje
it doesn't work i always can walk trough it but only not in the middle area from the truck.
my script:
Code: Select all
main:
exec global/ai.scr
exec global/loadout.scr maps/test_drivingtruck.scr
level waittill prespawn
level waittill spawn
level.script = "maps test_drivingtruck.scr"
thread drive
end
drive:
local.opel1.targetname = opel1
$opel1 solid
$opel1 hide
wait 5
$opel1.origin = $opel1start.origin
$opel1 show
exec global/spotlight.scr::corona $opel1 "light left"
exec global/spotlight.scr::corona $opel1 "light right"
$opel1 thread global/vehicles_thinkers.scr::enemy_truck_think 400 6 $opel1path
end
could you send a script that works if you now one and maybe how i make it mohradiant?
Posted: Thu Jun 04, 2009 7:56 pm
by Aprop
Download spearhead SDK and copy truck collision from one of example maps...then set it in script,
setcollisionentity.. and remove "truck solid" line!! Better never use it for vehs'..
btw what mean
..?
Posted: Fri Jun 05, 2009 12:43 pm
by SilentAngel
Never made vheic on maps so I'm not sure, but why solid doesn't works? I use it to spawn solid objects and worked everytime..
local.myobject.tergetname = name
is the same of local.object targetname name
..so you can use $name instead of local.object..isn't it?! well in this case if he use $opel1 he must have declared it before..of course the truck must be spawned with the name of local.opel1..
if he do not declare the target of the targetname then $ oper won't work at all!!
PS: what I said will be useless in case the $opel1 tn is one of these already existent, I mean something like $player or if $opel1 is set up in radiant! lol
Posted: Fri Jun 05, 2009 2:57 pm
by Aprop
Solid make trucks bounding box solid... setcollisionentity copy and bind the script objects to truck... yes, custom-shape script object that can be made from several brushes with diffrent textures, for truck cargo clip wood, for window glass clip, for metal metal clip etc
I know what local.myobject.tergetname = name makin, but it has non sense it dietie~~ script...
Posted: Fri Jun 05, 2009 4:39 pm
by SilentAngel
custom-shape script object that can be made from several brushes with diffrent textures, for truck cargo clip wood, for window glass clip, for metal metal clip etc
humm I didn't inderstood it was custom..also I dunno if there's a stock one lol!
I know what local.myobject.tergetname = name makin, but it has non sense it dietie~~ script...
..so how can he use $ if it's not declared the tergetname?
Never found a targetname of a entity that was not declared with the targetname command..
Posted: Fri Jun 05, 2009 4:52 pm
by dietje_schietje
So i must make brushes with clips and that will be my script object?
But i not really now the scripting part? I have give everything a targetname.
Posted: Fri Jun 05, 2009 5:14 pm
by Aprop
Download spearhead sdk, search the examples for truck collision entity (its probably in somethin called test_ai), select it, copy and place it somewhere on your map... and use the script
Code: Select all
main:
exec global/ai.scr
level waittill spawn
wait 1
$opel1 setcollisionentity $<targetname_of_copied_collision>
wait 1
$opel1 thread global/vehicles_thinkers.scr::enemy_truck_think 400 6 $opel1path
end
I assume you got vehicle/opeltruck targetnamed opel1 and info_vehiclepoint opel1path... <targetname_of_copied_collision> is targetname of collision copied from example...