Teleport vs Objectives (help ^^ ? )

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Teleport vs Objectives (help ^^ ? )

Post by |NSC|-Steelie-NS*LR* »

Hey,

Lately I have put a teleporter in The Bridge, which works fine.
It's made of a trigger-use, so you have to press 'e' before you will be teleported. But now, when you want to place the bomb, e doesn't work anymore! :s :( .

My script of obj/obj_team4 :

Code: Select all

// THE BRIDGE
// ARCHITECTURE: POWZER
// SCRIPTING: POWZER

main:


setcvar "g_obj_alliedtext1" "Defend the bridge" 
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""

setcvar "g_obj_axistext1" "Place an explosive"
setcvar "g_obj_axistext2" "under the bridge"
setcvar "g_obj_axistext3" "to destroy it"

setcvar "g_scoreboardpic" "objdm4"

	level waittill prespawn

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

	level.script = maps/obj/obj_team4.scr
	exec global/ambient.scr obj_team4
	
	thread global/exploder.scr::main
	thread global/minefield.scr::minefield_setup
	exec global/door_locked.scr::lock

	level waittill spawn
   
   
port1:

local.trig = spawn trigger_use
local.trig targetname port1 
local.trig.origin = ( 583 -2382 240 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 80 )
$port1 waittill trigger
local.player = parm.other
local.player tele ( 801 4431 240) // destination
local.portlight remove
$port1 remove
wait 7
thread port1
end


	level.defusing_team = "allies"
	level.planting_team = "axis"
	level.targets_to_destroy = 1 // only one of the two bombs in the level needs to be blown
	level.bomb_damage = 300
	level.bomb_explosion_radius = 1024

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

	level waittill roundstart
		
		$bridge_bomb thread global/obj_dm.scr::bomb_thinker
		$bridge_bomb2 thread global/obj_dm.scr::bomb_thinker
		
		$bridge_bomb thread axis_win_bomb
 		$bridge_bomb thread allied_win_timer
 		
//		thread objectives_setup
	
end


axis_win_bomb:

	while(level.targets_destroyed < level.targets_to_destroy)
		waitframe
		
	teamwin axis
end

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

allied_win_timer:

	level waittill allieswin

end


//THIS PORTION OF SCRIPT NOT READY TO IMPLEMENT
//objectives_setup:
//
//	waitthread global/objectives.scr::blank_objectives
//	waitthread global/objectives.scr::add_objectives 1 2 "Axis forces must destroy the bridge" $bridge.origin
//	wait 2
//	waitthread global/objectives.scr::current_objectives 1

end
I really want to use a trigger-use, not a multiple. But how can I fix it, so the bombs can still be placed. Not only the user of the teleport can't place it, but the rest of the team can't too. Even when you not use the teleport, the bombs can not be placed :s

Please help :)

Edit: Btw, bombs can be placed in other maps, like v2, cos there are no teleports :)
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

the port1 thread is inside the main thread, so this wont work.
u can try this:

Code: Select all

// THE BRIDGE 
// ARCHITECTURE: POWZER 
// SCRIPTING: POWZER 

main: 


setcvar "g_obj_alliedtext1" "Defend the bridge" 
setcvar "g_obj_alliedtext2" "" 
setcvar "g_obj_alliedtext3" "" 

setcvar "g_obj_axistext1" "Place an explosive" 
setcvar "g_obj_axistext2" "under the bridge" 
setcvar "g_obj_axistext3" "to destroy it" 

setcvar "g_scoreboardpic" "objdm4" 

   level waittill prespawn 

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

   level.script = maps/obj/obj_team4.scr 
   exec global/ambient.scr obj_team4 
    
   thread global/exploder.scr::main 
   thread global/minefield.scr::minefield_setup 
   exec global/door_locked.scr::lock 

   level waittill spawn 
 
   thread port1  //just call the thread from here

   level.defusing_team = "allies" 
   level.planting_team = "axis" 
   level.targets_to_destroy = 1 // only one of the two bombs in the level needs to be blown 
   level.bomb_damage = 300 
   level.bomb_explosion_radius = 1024 

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

   level waittill roundstart 
       
      $bridge_bomb thread global/obj_dm.scr::bomb_thinker 
      $bridge_bomb2 thread global/obj_dm.scr::bomb_thinker 
       
      $bridge_bomb thread axis_win_bomb 
       $bridge_bomb thread allied_win_timer 
        
//      thread objectives_setup 
    
end 


axis_win_bomb: 

   while(level.targets_destroyed < level.targets_to_destroy) 
      waitframe 
       
   teamwin axis 
end 

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

allied_win_timer: 

   level waittill allieswin 

end 


//THIS PORTION OF SCRIPT NOT READY TO IMPLEMENT 
//objectives_setup: 
// 
//   waitthread global/objectives.scr::blank_objectives 
//   waitthread global/objectives.scr::add_objectives 1 2 "Axis forces must destroy the bridge" $bridge.origin 
//   wait 2 
//   waitthread global/objectives.scr::current_objectives 1 

end 

port1:
while (1)
{ 
local.trig = spawn trigger_use 
local.trig targetname port1 
local.trig.origin = ( 583 -2382 240 ) // starting point 
local.trig setsize ( -30 -30 0 ) ( 30 30 80 ) 
$port1 waittill trigger 
local.player = parm.other 
local.player tele ( 801 4431 240) // destination 
local.portlight remove 
$port1 remove 
wait 7 
}
end 
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Post by |NSC|-Steelie-NS*LR* »

Ok, Thanks.

I'll try, will be back in a minute ;)

Edit: I've loaded the new script up, then I restarted the server.
Still no luck, teleport works, bombs not :'(


Do I have to call the thread after the bomb stuff?
Well I'll wait for your reply.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

well, give it a try :wink: put it here

Code: Select all

...
      $bridge_bomb thread axis_win_bomb 
       $bridge_bomb thread allied_win_timer 
        
//      thread objectives_setup 
    thread port1
end
... 
so, to understand it, atm the teleporting stuff does work and the bombs don't?! Or do the bombs not work, once the teleporter was used? And what is this local.portlight?
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Post by |NSC|-Steelie-NS*LR* »

Ok I'll try.

Teleports work Bombs don't ;)

Ow, and that portlight thing, it was from a light bulb, so you could see where the teleport was. I deleted the bulb, and forgot to delete that portlight remove thingy :)


But now I'll try that, get back in a minute ;)

Btw : I have put an extra end in the script, thought that might be neccesary :)

Code: Select all

		$bridge_bomb thread axis_win_bomb $bridge_bomb $bridge_bomb2
 		$bridge_bomb thread allied_win_timer
 		
//		thread objectives_setup

end
	thread port1
end
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

umm, no. ur extra end stops the main thread before executing the command "thread port1" and ur script can't reach it. neveretheless, it would be interesting whether the bombs did work this way (without the tele stuff) :wink:
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Post by |NSC|-Steelie-NS*LR* »

Well lol, i think ur right, with that extra end thing ;)

Now the bombs DO work, but the teleport doesn't .
So i'll will undo the xtra end and we'll see . :roll:

The bombs worked before.
User avatar
|NSC|-Steelie-NS*LR*
Sergeant
Posts: 54
Joined: Mon Dec 27, 2004 11:24 am
Location: The Netherlands
Contact:

Post by |NSC|-Steelie-NS*LR* »

Ok, it all works now :D

Thank you very very much for your help, it was appreciated ;)

If you now post a No problem reply, you'll have your 1960'th post ;)

Laterz
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

|NSC|-Steelie-NS*LR* wrote:If you now post a No problem reply, you'll have your 1960'th post ;)
Ah, no... this would be spamming, wouldn't it?
Ooops :P
Post Reply