OK!
Tried it without the script. Worked like a charm... Not really sure to use a

or a

... but I guess a

because a scrip error sure beats a bsp error.
So now I'm down to the script... cant see anyting wrong with it ( code blindness is a known fact of scripting ).
So I guess its OK to move this thread to scripting now.
So here is the main script:
Code: Select all
// obj_vemork_approach
// ARCHITECTURE: Bjarne Gr?nnevik
// SCRIPTING: Bjarne Gr?nnevik
// LINK: http://www.planetmedalofhonor.com/rjukanproject/
// VERSION: RC1
main:
setcvar "g_obj_alliedtext1" "Get past the Axis"
setcvar "g_obj_alliedtext2" "patrols and get to the"
setcvar "g_obj_alliedtext3" "factory to the south."
setcvar "g_obj_axistext1" "Scouts have reported"
setcvar "g_obj_axistext2" "Allied troops north"
setcvar "g_obj_axistext3" "of Vemork factory."
setcvar "g_scoreboardpic" "vemork_approach_status"
// Haze
$world farplane_color "0.5 0.4 0.5"
level.fogplane = 4500
$world farplane level.fogplane
level waittill prespawn
exec global/DMprecache.scr
level.script = maps/obj/obj_vemork_approach.scr
exec global/ambient.scr m6l1a
exec global/rjukanproject_scout.scr
level.dmrespawning = 0 // 1 or 0 (0=no respawn)
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = draw // set to axis, allies, kills, or draw
local.master = spawn ScriptMaster
local.master aliascache fireplace sound/amb/Amb_FirePlace.wav soundparms 1.3 0.0 1.0 0.0 150 2000 auto loaded maps "obj_vemork_approach dm obj"
local.master remove
level waittill spawn
//The snow
level.rain_speed = "32"
level.rain_speed_vary = "16"
level.rain_length = "2"
level.rain_width = "1"
level.rain_density = "0.2"
level.rain_slant = "250"
level.rain_min_dist = "1800"
level.rain_numshaders = 12
level.rain_shader = "textures/snow7"
level waittill roundstart
thread print_message
$fire_speaker loopsound fireplace
// All objectives handled by triggers calling the below methods...
end
/******************************************************************
* Axis victory test ( Win by timeout or eradication of opposing
* force )
*/
axis_win_timer:
level waittill axiswin // At the end Axis win
end
/******************************************************************
* Checks to see if an allied soldier has reached the escape area.
*/
objective_reached:
if(parm.other.dmteam == allies) { // parm.other is the triggerer
iprintlnbold_noloc "The allies have escaped!"
teamwin allies
}
else
{
if ( parm.other.dmteam == axis )
{
parm.other iprint "You are trying to leave the area," 0
parm.other iprint "get back and kill the allies!" 1
}
}
end
/******************************************************************
* Level start message. Printed randomly.
*/
print_message:
println ("print_message thread started")
if (randomint(15) == 0)
{
iprintlnbold_noloc "In the mountains somewhere above the"
iprintlnbold_noloc "Heavy water production plant at Vemork"
iprintlnbold_noloc "in Rjukan, Norway, feb 1943."
}
end
/******************************************************************
* Warn forces that try to escape on the allies side of the map.
*/
allied_chicken_warning:
parm.other iprint "You are trying to leave the area," 1
parm.other iprint "get back to the mission soldier!" 1
end
/******************************************************************
* Punish forces that try to escape on the allies side of the map.
*/
allied_chicken_punishment:
parm.other hurt 10 "BULLET"
if (randomint(4) == 0)
{
parm.other iprint "Get back in there soldier!" 1
}
end
/******************************************************************
* Punish axis forces that try to escape on the axis side of the
* map.
*/
axis_chicken_punishment:
if ( parm.other.dmteam == axis )
{
parm.other hurt 10 "BULLET"
if (randomint(4) == 0)
{
parm.other iprint "Get back in there kraut!" 1
}
}
end
/******************************************************************
* Make fire hurt players.
*/
fire_hurt:
parm.other hurt 10 "FIRE"
end
/******************************************************************
* Kill any players managing to get under the map.
*/
landshark_hurt:
iprintlnbold_noloc "A landshark is beeing burned in hell!" 1
parm.other hurt 666 "FIRE"
end
/******************************************************************
* Activated when allies has traveled 2/3 of the map.
*/
allied_breach:
if ( parm.other.dmteam == allies )
{
if (!level.breach)
{
level.breach = 1
iprintlnbold_noloc "The allies have passed the stone wall!"
}
}
end
/******************************************************************
* Give the players the ability to "tag" enemy with the binoculars.
*/
clickitem_fail:
exec global/rjukanproject_scout.scr::binocular_fire
end
I've tried to rip out the scouting, no difference...
I've tried to change
level.clockside...
Every part of the script works, except that it crashes the server after the first round when
logfile and
developer is set to
0...
And here is global/rjukanproject_scout.scr:
Code: Select all
// Scout modification
// ARCHITECTURE: Bjarne Gr?nnevik
// SCRIPTING: Bjarne Gr?nnevik
// LINK: http://www.planetmedalofhonor.com/rjukanproject/
// VERSION: BETA
// THANX: jv_map at .MAP for all the help and code.
/******************************************************************
* How to insert scouting in your map:
*
* 1) Put user-rjukanproject_scout.pk3 in the <MOHAA>/main folder.
* 2) Insert this line in your main method ( after roudstart ):
* exec global/rjukanproject_scout.scr
* 3) Insert this method last in your script ( outside of main ):
* clickitem_fail:
* exec global/rjukanproject_scout.scr::binocular_fire
* end
* 4) Done! Lets scout them out!
*/
/******************************************************************
* Script main entry point.
*/
main local.instruction_frequency:
local.master = spawn ScriptMaster
local.master aliascache snd_binoculars sound/mechanics/Mec_RadioNoise_11.wav soundparms 0.5 0.2 0.9 0.1 160 1600 item loaded
maps "dm obj"
local.master remove
level waittill spawn
level.the_gametype = int( getcvar( g_gametype ) )
if (local.instruction_frequency == NIL)
{
local.instruction_frequency = 15
}
thread print_instructions local.instruction_frequency
end
/******************************************************************
* Level start message. Printed randomly.
*/
print_instructions local.inst_freq:
println ("print_instructions thread started")
wait 10
if (randomint(local.inst_freq) == 0)
{
iprintlnbold_noloc "You can scout by using your binoculars:"
iprintlnbold_noloc "(Aim at an enemy and press fire to mark"
iprintlnbold_noloc "them with intense colored lights)"
} else {
if (randomint(40) == 0)
{
iprintlnbold_noloc "Scout modification by The Rjukan project:"
iprintlnbold_noloc "www.planetmedalofhonor.com/rjukanproject"
}
}
end
/******************************************************************
* Give the players the ability to "tag" enemy with the binoculars.
*/
binocular_fire:
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * $world.farplane) 0
local.ent = spawn script_origin origin local.hit_location
// local.beam = spawn func_beam origin local.start endpoint local.hit_location maxoffset 0
// local.beam color (0 1 0)
// local.beam doActivate
// local.beam commanddelay 1 remove
println "Binocular target: " local.hit_location
if ( $player.size > 1 )
{
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.player = $player[local.i]
if(self != local.player)
{
if(self.dmteam != local.player.dmteam)
{
if(local.ent isTouching local.player)
{
self iprint "You have tagged an enemy soldier!" 1
local.player thread light_up 0
break
}
}
else
{
if(level.the_gametype == 1)
{
if(local.ent isTouching local.player)
{
self iprint "You have tagged an enemy soldier!" 1
local.player thread light_up 1
break
}
}
}
}
}
}
local.ent immediateremove // do it! do it now! :)
end
/******************************************************************
* Light up a player as a chrismas tree ( if not already lit ).
*/
light_up local.ffa:
println "Player tagged: " self "(Glow-state=" self.glowing ")"
if( self.glowing != 1 )
{
if(local.ffa == 1) {
{
self light 0.0 1.0 0.0 300
}
}
else
{
if ( self.dmteam == allies ) // can be 'spectator', 'freeforall', 'allies' or 'axis'
{
self light 0.0 0.0 1.0 300
}
else
{
if ( self.dmteam == axis )
{
self light 1.0 0.0 0.0 300
}
}
}
self iprint "You have been sighted by an enemy scout!" 1
self lightOn
self.glowing = 1
wait 10
self lightOff
self.glowing = 0
}
end
...but as I said, removing it did not remove the problem...
So, anyone without code blindness that can spot the error ( see earlier posts for crash details )
