I have made a boat in my level, made it and scripted it just like the tank prefabs, but for mine, when i go into the map, the boat is outside of the map, past the sky texture?!?!?!?!
i dont understand why it isn’t in the map, i was thinking it could be the boat, because it isn’t a gamemodel, its just brush objects in the shape of a boat. everything looks ok though in the map editor,
here is the script
VVVV
boat
{
//----------------------------------------------------------------------
// The following are events that this entity is capable of triggering
//----------------------------------------------------------------------
spawn
{
// Set variables to defaults
accum 0 set 0 // State
accum 1 set 0 // Path state
accum 1 bitset 0 // Set obstacle 0 as present
accum 3 set 0 // Reset stop timer
accum 9 set 0 // Reset script lockout counter
// Wait for entities to spawn
wait 100
// Set initial position to the first waypoint
followspline 0 waypoint_000 10000
accum 2 set 1
// Set default state (ie. boat ready)
trigger self sound_idle
trigger self anim_tracks_stop
setstate boat_smoke invisible
}
// Called when the entity is hurt
pain
{
}
// Called when the entity is destroyed
death
{
// Update state bits
accum 0 bitset 0 // Mark as broken, which mean it will stop at next waypoint
}
// Indirectly called when the entity is repaired
rebirth
{
// Lock script
trigger self script_lock
// Remove smoke
setstate boat_smoke invisible
// Start
trigger boat_sound rebirth
wait 500
// Update state bits
accum 0 bitreset 0 // Mark as not broken
accum 0 bitreset 4 // Mark as visually not broken
// Unlock script
trigger self script_unlock
}
// Called when a player is using the mounted MG
mg42 mount
{
}
// Called when a player is no longer using the mounted MG
mg42 unmount
{
}
//----------------------------------------------------------------------
// Trigger functions
//----------------------------------------------------------------------
// This function is called when a player moves inside the escort zone
trigger escort_trigger
{
// Check for obstacles
trigger self check_obstacle_status
// Update state bits and counters
accum 0 bitset 2 // Mark as escort present
accum 3 set 0 // Reset stop timer
// Check if allowed to move
accum 0 abort_if_bitset 0 // Abort if its broken
accum 0 abort_if_bitset 1 // Abort if its already moving
accum 0 abort_if_bitset 3 // Abort if an obstacle is in the way
accum 9 abort_if_not_equal 0 // Abort if the script is currently locked
// Lock script
trigger self script_lock
// Starting state
trigger boat_sound start
startanimation 55 10 15 nolerp norandom
wait 666
// Driving state
trigger self anim_tracks_forward
startanimation 5 40 15 nolerp norandom
// Wait a bit before starting to move
wait 500
// Unlock script
trigger self script_unlock
// Start movement loop
trigger self move
}
// This function is called periodicly by a func_timer entity in the map.
// Each time it checks a counter to see if the escort has been gone too
// long. The counter is reset by the escort trigger function.
trigger timer
{
// Increase counter, and if it hasn't reached 4 then abort
accum 3 inc 1
accum 3 abort_if_less_than 4
// Update state bits
accum 0 bitreset 2 // Mark as not escorted, which means it will stop at next waypoint
// Need to periodicly check if the tank has been damaged
trigger self check_death
}
//----------------------------------------------------------------------
// Waypoint functions that checks if it can proceed to the next waypoint
//----------------------------------------------------------------------
// Check if its broken, and if so change to the broken state
trigger check_death
{
// Check if its broken
accum 0 abort_if_not_bitset 0 // Abort if not broken
accum 0 abort_if_bitset 1 // Abort if its already moving
accum 0 abort_if_bitset 4 // Abort if its already in its broken state
accum 9 abort_if_not_equal 0 // Abort if the script is currently locked
// Lock script
trigger self script_lock
// This target_kill entity will kill the func_constructible so that an engineer can repair it
alertentity boat_kill
// Start smoking
setstate boat_smoke default
// Death sound
trigger self sound_death
// Stopping state
trigger self anim_tracks_stop
startanimation 45 10 15 nolerp norandom
wait 666
// Stationary state
startanimation 0 1 15 nolerp norandom
// Update state bits
accum 0 bitset 4 // Mark as visually broken state
// Unlock script
trigger self script_unlock
}
// Check if it isn't escorted, and if not then stop it
trigger check_escort
{
// Check if its not escorted
accum 0 abort_if_bitset 2 // Abort if escort is present
// Lock script
trigger self script_lock
// Stop sound
trigger boat_sound stop
// Stopping state
trigger self anim_tracks_stop
startanimation 45 10 15 nolerp norandom
wait 666
// Stationary state
startanimation 0 1 15 nolerp norandom
// Unlock script
trigger self script_unlock
}
//----------------------------------------------------------------------
// Misc. functions
//----------------------------------------------------------------------
trigger script_lock
{
accum 9 inc 1
}
trigger script_unlock
{
accum 9 inc -1
}
//----------------------------------------------------------------------
// Move functions
//----------------------------------------------------------------------
// Dispatching move function
trigger move
{
// The obstacle bit is still valid because of the obstacle check done by the calling function
accum 0 abort_if_bitset 3 // Abort if an obstacle is in the way
// List of waypoints to go to
accum 2 trigger_if_equal 1 tank1 move_to_001
accum 2 trigger_if_equal 2 tank1 move_to_002
accum 2 trigger_if_equal 3 tank1 move_to_003
accum 2 trigger_if_equal 4 tank1 move_to_004
accum 2 trigger_if_equal 5 tank1 move_to_005
accum 2 trigger_if_equal 6 tank1 move_to_006
accum 2 trigger_if_equal 7 tank1 move_to_007
}
// Move to waypoint 001
trigger move_to_001
{
accum 0 bitset 1 // Mark as moving
followspline 0 waypoint_001 80 wait length -64
accum 0 bitreset 1 // Mark as not moving
trigger self move_increment
}
// Move to waypoint 002
trigger move_to_002
{
accum 0 bitset 1 // Mark as moving
followspline 0 waypoint_002 80 wait length -64
accum 0 bitreset 1 // Mark as not moving
trigger self move_increment
}
// Move to waypoint 003
trigger move_to_003
{
accum 0 bitset 1 // Mark as moving
followspline 0 waypoint_003 80 wait length -64
accum 0 bitreset 1 // Mark as not moving
trigger self move_increment
}
// Move to waypoint 004
trigger move_to_004
{
accum 0 bitset 1 // Mark as moving
followspline 0 waypoint_004 80 wait length -64
accum 0 bitreset 1 // Mark as not moving
trigger self move_increment
}
// Move to waypoint 005
trigger move_to_005
{
accum 0 bitset 1 // Mark as moving
followspline 0 waypoint_005 80 wait length -64
accum 0 bitreset 1 // Mark as not moving
trigger self move_increment
}
// Move to waypoint 006
trigger move_to_006
{
accum 0 bitset 1 // Mark as moving
followspline 0 waypoint_006 80 wait length -64
accum 0 bitreset 1 // Mark as not moving
trigger self move_increment
}
// Move to waypoint 007
trigger move_to_007
{
accum 0 bitset 1 // Mark as moving
followspline 0 waypoint_007 80 wait length -64
accum 0 bitreset 1 // Mark as not moving
}
//----------------------------------------------------------------------
// Boat sounds
//----------------------------------------------------------------------
trigger sound_idle
{
stopsound
playsound sound/vehicles/tank/tank_idle.wav looping volume 512
}
trigger sound_start
{
stopsound
playsound sound/vehicles/tank/tank_revup.wav volume 196
}
trigger sound_move
{
stopsound
playsound sound/vehicles/tank/tank_move.wav looping volume 512
}
trigger sound_stop
{
stopsound
playsound sound/vehicles/tank/tank_revdown.wav volume 196
}
trigger sound_death
{
stopsound
playsound sound/vehicles/tank/tank_stop.wav volume 256
}
trigger sound_rebirth
{
stopsound
playsound sound/vehicles/tank/tank_start.wav volume 196
}
}
//======================================================================
// The following are related entities which are attached because they need to follow the script_mover
//======================================================================
boat_enabler_trigger
{
spawn
{
// Wait for host entity to spawn
wait 100
// Attaches itself to a tag on the script_mover
attachtotag boat tag_turret
}
}
boat_smoke
{
spawn
{
// Wait for host entity to spawn
wait 100
// Attaches itself to a tag on the script_mover
attachtotag boat tag_turret
// Turn off smoking
alertentity boat_smoke
}
}
boat_toi
{
spawn
{
// Wait for host entity to spawn
wait 100
// Attaches itself to a tag on the script_mover
attachtotag boat tag_turret
}
}
//======================================================================
// The following are the remaining entities
//======================================================================
boat_construct
{
spawn
{
// Needed for the icon to reappear correctly on the command map
constructible_class 2
}
// Called when the repairs are starting
buildstart final
{
}
// Called when the repairs have failed
decayed final
{
}
// Called when the repairs have failed
failed
{
}
// Called when the repairs are done
built final
{
// Resurrect the entity. This fills up its health and trigger the ::rebirth function
alertentity tank1
}
}
boat_disabler
{
spawn
{
}
trigger run
{
// Call the function which controls the escort timeout
trigger tank1 timer
}
}
boat_enabler
{
spawn
{
}
trigger run
{
// Call the function which handles the escort
trigger tank1 escort_trigger
}
}
boat_kill
{
spawn
{
}
}
boat_timer
{
spawn
{
}
}
//======================================================================
// This block contains sound redirectors. Since commands are executed in order
// the only way to have multiple waits at the same time is to play them through another scriptblock
//======================================================================
boat_sound
{
spawn
{
}
trigger start
{
trigger boat sound_start
wait 3400
trigger boat sound_move
}
trigger stop
{
trigger boat sound_stop
wait 1400
trigger boat sound_idle
}
trigger rebirth
{
trigger boat sound_rebirth
wait 1400
trigger boat sound_idle
}
trigger turret_fire
{
trigger boat_turret sound_fire
}
trigger turret_turn_start
{
trigger boat_turret sound_turn_start
}
trigger turret_turn_stop
{
trigger boat_turret sound_turn_stop
}
}
yes i havent changed the tank sounds yet, so it still sounds like a tank
need help
thanks
~l3
<----