Page 1 of 1

Help with Script

Posted: Fri Apr 15, 2005 2:37 pm
by ghsthunter23
Ok here is my script, i want to no whats wrong, when i go in game, nothing appears. So i cant test it, i tried looking in the log file but noting appears there either. :shock:

Code: Select all

// SOUTHERN FRANCE
// ARCHITECTURE: SENN
// SCRIPTING: POWZER

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Southern France Edit"
setcvar "g_obj_alliedtext2" "Edit By"
setcvar "g_obj_alliedtext3" "G-Unit"
setcvar "g_obj_axistext1" "{AXS}"
setcvar "g_obj_axistext2" "www.alienxsoftware.co.uk"
setcvar "g_obj_axistext3" "Come An Play"

setcvar "g_scoreboardpic" "mohdm1"

	

	// call additional stuff for playing this map round based is needed
	if(level.roundbased)
		thread roundbasedthread
		
	level waitTill prespawn
////////////////////////////////////
///////// Medic ///////////////////
//////////////////////////////////
medbox:
local.medbox = spawn script_model
local.medbox model "items/item_100_healthbox.tik"
local.medbox.origin = ( 151.63 484.00 384.13 ) 
local.medbox.angles = ( 0 0 0 )
local.medbox.scale = 1.0
local.medbox light 1 0 100 0
local.medbox solid
local.medboxtrig = spawn trigger_use
local.medboxtrig targetname medbox
local.medboxtrig.origin = ( 151.63 484.00 384.13 ) 
local.medboxtrig setsize ( -20 -20 30 ) ( 30 30 80 )
local.medboxtrig message "You are now a medic (Hold E and Aim your laser on a person)"
local.medboxtrig setthread medic1

Medic1:
self waittill trigger 
local.player=parm.other
	if (local.player.useheld == 1)
	{
	local.player.usinglaser = 1
			local.medic1 setthread ent
			local.ent = spawn func_beam
			local.ent.origin = local.medbox.origin
			local.ent minoffset 0.0
			local.ent maxoffset 0.0
			local.ent numsegments 1
			local.ent life 0
			local.ent color ( 0 0 100 )
			local.ent alpha 0.4
			local.ent alwaysdraw
			local.ent activate
			local.ent scale .5
			local.ent setthread ent1
end
			ent1:
			local.ent1 = spawn script_model
			local.ent1 model "items/dm_50_healthbox.tik"
			local.ent1origin = (trace local.entorigin (local.entorigin + 350 ))
	
while (local.player.useheld)
	{

if (local.ent1 isTouching local.body.team)
	{
	local.body.team fullheal
	local.ent color (100 0 0)
	{




	//*** Precache Dm Stuff
	exec global/DMprecache.scr

	level.script = maps/dm/mohdm1.scr
	exec global/ambient.scr mohdm1

	//exec global/ambient.scr mohdm2

	//$world farplane 5000
	//$world farplane_color (.333 .333 .329)

	level waittill spawn

end

//-----------------------------------------------------------------------------

roundbasedthread:

	// Can specify different scoreboard messages for round based games here.
	
	level waitTill prespawn

	level waittill spawn

	// set the parameters for this round based match
	level.dmrespawning = 0 // 1 or 0
	level.dmroundlimit = 5 // round time limit in minutes
	level.clockside = kills // set to axis, allies, kills, or draw

	level waittill roundstart

end
[/code]

Posted: Fri Apr 15, 2005 3:17 pm
by At0miC
Put an "end" under "local.medboxtrig setthread medic1" I guess

Posted: Fri Apr 15, 2005 4:58 pm
by Unreal_Demon

Code: Select all

local.ent1origin = (trace local.entorigin (local.entorigin + 350 ))
Should be

Code: Select all

local.ent1.origin = (trace local.entorigin (local.entorigin + 350 ))

Posted: Sat Apr 16, 2005 7:21 am
by bdbodger
// SOUTHERN FRANCE
// ARCHITECTURE: SENN
// SCRIPTING: POWZER

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Southern France Edit"
setcvar "g_obj_alliedtext2" "Edit By"
setcvar "g_obj_alliedtext3" "G-Unit"
setcvar "g_obj_axistext1" "{AXS}"
setcvar "g_obj_axistext2" "www.alienxsoftware.co.uk"
setcvar "g_obj_axistext3" "Come An Play"

setcvar "g_scoreboardpic" "mohdm1"



// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread

level waitTill prespawn
////////////////////////////////////
///////// Medic ///////////////////
//////////////////////////////////

thread medbox // <========= run threads like this

end // <========= You need to end this thread here after you move up the stuff at the bottom

medbox:
local.medbox = spawn script_model
local.medbox model "items/item_100_healthbox.tik"
local.medbox.origin = ( 151.63 484.00 384.13 )
local.medbox.angles = ( 0 0 0 )
local.medbox.scale = 1.0
local.medbox light 1 0 100 0
local.medbox solid
local.medboxtrig = spawn trigger_use
local.medboxtrig targetname medbox
local.medboxtrig.origin = ( 151.63 484.00 384.13 )
local.medboxtrig setsize ( -20 -20 30 ) ( 30 30 80 )
local.medboxtrig message "You are now a medic (Hold E and Aim your laser on a person)"
local.medboxtrig setthread medic1

end // <========= You need to end this thread here setthread starts the medic1 thread

Medic1:
self waittill trigger//<==== This thread is started by setthread this in not needed
local.player=parm.other
if (local.player.useheld == 1)
{// <==========You have a start bracket here where is the end bracket for it?
local.player.usinglaser = 1
local.medic1 setthread ent // <========== No local.medic1 defined
local.ent = spawn func_beam
local.ent.origin = local.medbox.origin // <========== No local.medbox defined in this thread use level.medbox in previous thread if you want to do this
local.ent minoffset 0.0
local.ent maxoffset 0.0
local.ent numsegments 1
local.ent life 0
local.ent color ( 0 0 100 )
local.ent alpha 0.4
local.ent alwaysdraw
local.ent activate // <========== func beam needs an endpoint
local.ent scale .5
local.ent setthread ent1 // <========== You can not use setthread with a func beam I don't think you need this line or the next 2 lines
end
ent1:
local.ent1 = spawn script_model
local.ent1 model "items/dm_50_healthbox.tik"
local.ent1origin = (trace local.entorigin (local.entorigin + 350 ))// <======= local.entorigin should be local.ent.origin I assume? also what is (local.entorigin + 350 ) ? + 350 on what axis x,y or z ? Where is this trace suppose to end ?

while (local.player.useheld) // <======= local.player is not defined in this thread if you end it above just before the ent1: line that I said was not needed
{// <==========You have a start bracket here where is the end bracket for it?

if (local.ent1 isTouching local.body.team)// <======= local.body is not defined in this thread and it's team value is not either but even if it was istouching is not right
{
local.body.team fullheal // <======= local.body is not defined in this thread
local.ent color (100 0 0) // <======= no local.ent in this thread if you end it above just before the ent1: line that I said was not needed
{


// <======= All this stuff should be at the top of the script before any threads are called ========

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm1.scr
exec global/ambient.scr mohdm1

//exec global/ambient.scr mohdm2

//$world farplane 5000
//$world farplane_color (.333 .333 .329)

level waittill spawn

end


//-----------------------------------------------------------------------------
// <=====================================================================================================
roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn

// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw

level waittill roundstart

end