I need some scripting Help - Please

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

I need some scripting Help - Please

Post by Shifty »

Ok in my map "War in a hall" i have two objectives

01. Kill The German Officer :lol:
02. Steal the Documents

I've got the 1st objective working fine and i made a small stealing documents map (to see if I could do it) now I just need to put the 2nd objective into my script - How do i seperate the objectives in the scripts - ie how do I write it with 2 objectives?

Thanks
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Maybe you can make your first objective:

//blah blah blah

thread 1st_objective
end

1st_objective:
//your code here
thread 2nd_objective
end

2nd_objective:
//your code here
thread allied_victory
end

//axis victory

allied_victory:
//blah blah blah
end
Live to map, not map to live.
-mohaa_rox, .map
moderator
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Thx

Post by Shifty »

Ok Thanks mohaa_rox ill try that out
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

oh dear

Post by Shifty »

So i looked at what u puit put and I don't really get it

You must understand that when it comes to scripting i aint the cleverest man in town - could you make it a little easier to understand?

This is what I have in for the Killing Objective how/where do I integrate the stealing documents objective?

Code: Select all

// War In a Hall (Obj)
// ARCHITECTURE: Shifty 
// SCRIPTING: Shifty
main:

	exec global/ai.scr         //*** Putting these in seems to make him act realistic, hiding for
	exec global/friendly.scr   //*** grenades & stuff. Add some patnodes around him to enhance this effect.


	level waittill prespawn

	exec global/DMprecache.scr

	level.script = maps/obj_warhall.scr     //*** Name of your script file, should be same as your map, just .scr in stead of .bsp
	exec global/ambient.scr obj_warhall
	
	exec global/door_locked.scr::lock

	exec global/exploder.scr	

	setcvar "g_obj_alliedtext1" "- Kill the Nazi Officer" 
	setcvar "g_obj_alliedtext2" "-Steal the Documents"
	setcvar "g_obj_alliedtext3" ""
	setcvar "g_obj_axistext1" "Protect the officer"
	setcvar "g_obj_axistext2" "at all costs."
	setcvar "g_obj_axistext3" "Stop the Allies"
	setcvar "g_scoreboardpic" "none"


	level waittill spawn

	level.dmrespawning = 0 //***  1 (wave based) or 0 (round based)
	level.dmroundlimit = 5 //***  round time limit in minutes
	level.clockside = axis //***  set to axis, allies, kills, or draw


	level waittill roundstart

	thread targetguy_deathtracker
	thread axis_win_timer

end


//*** --------------------------------------------
//*** "Check for Targetguy's death"
//*** --------------------------------------------

targetguy_deathtracker:

	if (isAlive $targetguy)
		$targetguy waittill death
	
	thread targetguy_was_killed
end


//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

	level waittill axiswin

end


//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

targetguy_was_killed:

	teamwin allies

end
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

anyone????

Post by Shifty »

Can't someone Help????
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

shifty wrote: exec global/ai.scr
//*** Putting these in seems to make him act realistic, hiding for grenades & stuff. Add some patnodes around him to enhance this effect.
Nooo! :( That script is used for enemy spawners :x

I suppose you've got a documents code somewhere? For example with a trigger and a setthread? Then set a variable when this objective is done, for example level.obj_docs = 1.

Also set a variable when $targetguy is killed. E.g. level.obj_officer = 1.
Make sure to remove the reference to 'targetguy_was_killed' thread, or the allies will win whenever they've killed the officer.

Then, remove the call to the axis_win_timer thread and the thread itself, because it doesn't do anything at all. Below that, paste the following win code or something alike:

Code: Select all

while(level.obj_docs != 1)
    wait 0.5

while(level.obj_officer != 1)
   wait 0.5

teamwin allies
Maybe that helps.
Image
Shifty
Map Reviewer
Posts: 717
Joined: Sun Dec 15, 2002 11:53 pm
Location: UK
Contact:

Thank you, thank you, thank you :)

Post by Shifty »

Yeeeeeeesssssssss My map works now - It's probably the dirtiest script ever but it works :D :D :D :D :D :D

So all i need to do is to put some extra lights in the map and then i'll post a link to it on .map and hopefully you guys can take a look at it and tell me if im missing anything or if i can improve it

Thanks again .map people this wouldnt have been done without ya
.MDT Webmaster, Mapper, Moddeler & Concept Artist
.Map Reviewer
Image
http://www.shiftys-bunker.tk Under Construction
Post Reply