Page 2 of 2

Posted: Fri Apr 27, 2007 9:34 pm
by Rich Tea Biscuit
[quote="tltrude"]
Your map does have a script, right?
quote]


Urmm.. Kind of.. Im sorta being the optimistic enthuastic moron who's trying to do everything at once.. realistically, the map isnt finished, so no, it doesnt have a complete script, per se.. certainly no where near finished at least, but since I have my shaders for custom textures in a pk3 already, I was hoping to put the scripts in the pk3 halfway through the project so I can test various bits everytime I do a minor compile with MBuilder..

script

Posted: Sat Apr 28, 2007 3:57 am
by tltrude
I don't know your map's name, but below is a standard DM type script. If you change the name to your map's name and save it as "yourmapname.scr" in main/maps/dm, you'll have a script -- random death included.

Code: Select all

// DEATH MAP
// ARCHITECTURE: RICH TEA BISCUITS
// SCRIPTING:  RICH TEA BISCUITS

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Die at Random!"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" ""

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

	level waittill prespawn

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

	level.script = maps/dm/death_map.scr  // Change this to your map's name.
	exec global/ambient.scr mohdm7  // Background sound, just wind.

	thread random_death_thread
	
	level waittill spawn

end

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

roundbasedthread:

	// Can specify different scoreboard messages for round based 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

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

random_death_thread: 
  
   $kill_trigger waittill trigger 
   local.num = randomint($player.size) 
   local.sucker = $player[local.num] 
   local.sucker damage local.sucker 120 local.sucker (0 0 0) (0 0 0) (0 0 0) 1 2 6 0 
   wait 1 
   local.fire = spawn script_model angle "-1" 
   local.fire model "emitters/firegood.tik" 
   local.fire.scale = .75 
   local.fire.origin = local.sucker.origin + (0 0 16) 
   wait 9.5 
   local.fire remove 

   goto death_thread 
  
end


Posted: Sat Apr 28, 2007 12:01 pm
by Rich Tea Biscuit
Oh WOW.. Thank you so much..

I'll link in the trigger next time I'm on. Thank you so very much for the help Tom. I presume any additional script I put into the .scr file has to go below the death_thread, followed by end, right? (I'll be honest, I was thinking of nabbing your trapdoor :mrgreen: but I might get feeling guilty now..)

Script & Threads

Posted: Sat Apr 28, 2007 1:42 pm
by tltrude
First Scripting Lesson:

The whole thing is called a "Script". The sections inside the script are called "Threads". Threads have "Lines" which are read by the game.

First Test Question:

Your script has three threads so far. Can you name them and tell what puncuation is used to show where one begins? HINT: "//" is used to add script comments which are not read by the game.

You can use anything you wish from my tutorial maps. They were made to be copied.

Posted: Sat Apr 28, 2007 5:04 pm
by Rich Tea Biscuit
Okies.. The three threads are:

The main obligatory stuff (main)
The Round Based (roundbasedthread)
And the Random lets kill everyone (random_death_thread)


And as for the punctuation, im presuming its the double colon ( : ) at the end of the thread name??

So Prof.. how did I do?? If all else fails, I have a nice shiny apple here...

Image

A

Posted: Sat Apr 28, 2007 11:09 pm
by tltrude
A+

Posted: Sat Apr 28, 2007 11:51 pm
by lizardkid
so can i have the apple?

Posted: Sun Apr 29, 2007 1:22 am
by Rich Tea Biscuit
Hm... I was kinda hoping to have it as a reward.. Meh. I'll find another Apple picture and devour that instead. You keep this one..