Kill, Kill and Kill again

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Rich Tea Biscuit
Corporal
Posts: 34
Joined: Wed Apr 25, 2007 11:57 pm
Location: mohaa\dm2

Post 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..
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script

Post 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

Tom Trude,

Image
Rich Tea Biscuit
Corporal
Posts: 34
Joined: Wed Apr 25, 2007 11:57 pm
Location: mohaa\dm2

Post 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..)
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Script & Threads

Post 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.
Tom Trude,

Image
Rich Tea Biscuit
Corporal
Posts: 34
Joined: Wed Apr 25, 2007 11:57 pm
Location: mohaa\dm2

Post 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
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

A

Post by tltrude »

A+
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

so can i have the apple?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rich Tea Biscuit
Corporal
Posts: 34
Joined: Wed Apr 25, 2007 11:57 pm
Location: mohaa\dm2

Post 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..
Image
Post Reply