Countdown Boiler Bash Mod

Started by easymeat {sfx}, December 24, 2015, 03:59:49 PM

Previous topic - Next topic

easymeat {sfx}

ok what I'm trying to do is combine 2 mods countdown1.7 with  Stalingrad_Weapon-Select_Boiler-Room, I did that and made the boiler room a bash only and when they are looking for the radio they use normal weapons works great. Now what I need is to get a trigger working that will teleport players into boiler room when they get the radio where they have to defend it by only bashing. . My problem is I'm not sure how to make my teleport trigger get the same coord as the radio. here's what I've tried so far.

// not sure if it goes here or not from the radio script.
// give radio to the player
give_radio local.player:

local.player playsound m3l2_radio_pickup
local.player attachmodel level.radio_model "Bip01 Pelvis" 0.8 "pelvis_radio" 1 -1 -1 -1 -1 ( 1.5 -4 -10.0 )
$pelvis_radio.angles = ( 0 90 90 )

local.light = getcvar "countdown_light"

if(local.light != "0")
{
local.player light 1 0 0 100
}
thread teleport //local.player exec HTR/player_radio.scr

end
///////////////////////////// added this ///////////////////////////////

teleport:
// random spots in boiler room

local.dest[1] = ( 648.75 126.63 -151.88 )
local.dest[2] = ( 637.30 -348.00 -151.88 )
local.dest[3] = ( 408.71 -623.16 -151.88 )
local.dest[4] = ( 223.14 -87.80 -151.88 )
local.dest[5] = ( 348.18 -112.98 32.13 )
local.dest[6] = ( 690.19 62.80 32.13 )
local.dest[7] = ( 657.09 -594.28 -151.88 )

local.trigger = spawn trigger_multiple
local.trigger targetname teleporttrigger
local.trigger.origin = ( local.radio.origin )
local.trigger setsize ( -20 -20 -10) ( 20 20 10)
local.trigger setthread telep

telep:
local.trigger waitTill trigger
local.destination = local.dest[((randomint local.dest.size) + 1)]
local.p = parm.other
local.p tele local.destination
{
local.player exec HTR/player_radio.scr
}
end


and I get this error message which I have no idea what it means...lol.

local.trigger.origin = local.radio.origin (htr/radio.scr, 199)
local.trigger.origin = local.radio^

^~^~^ Script Error: Cannot cast 'NIL' to listener

local.trigger.origin = local.radio.origin (htr/radio.scr, 199)
local.trigger^

^~^~^ Script Error: Cannot cast 'NIL' to vector



is my trigger wrong or am I putting it in the wrong place?

=[M.A.W]=DoubleKill

#1
you have to get the origin of the boiler and tele the player to there if he is holding the radio something like this:


local.boiler = ( 1 2 3 )

if(local.player.have_radio == 1 && local.player.onboiler == NIL)
{
local.player tele local.boiler
local.player.onboiler = 1

}




Cobra {sfx}

 local.trigger.origin = ( local.radio.origin )

Should be  local.trigger.origin = local.radio.origin ... but i dont see local.radio mentioned anywhere so the trigger doesnt know where you want to put it

Sleep? What is that?

easymeat {sfx}

I put the teleport in the radio script thinking it would find it  when radio was  glued to the player,   but I see I had it all wrong  I just tried sticking a teleport script I had  in it
thinking it would use the countdown mods script to find the radio
Thanks guys learn another new thing today so all is  good.




 

Cobra {sfx}

Try adding level.radio_model = local.radio just above the trigger, so local.radio exists in this thread
Sleep? What is that?

easymeat {sfx}

#5
I got it every thing working, I don't know if it's the way a real scripter would do it but it works. Here's the code for radio.scr stuck the teleport at bottom of script. Then I had to redo the old and add some new  triggers to take weapons and give the bash only pistol and change the triggers to return weapons when leaving the boiler room ( had help redoing that from Sor on X-Null )  The Stalingrad_Weapon-Select_Boiler-Room was made by splaterguts and the countdown mod was done by Elgan I think it came from admin pro. Just wanted to let people know I didn't do these mods. I stuck it on here if anyone wants to try it out. Thanks for responding to this post guys.

The 

// 22/11/2005 18:07 added in radio drop features

main local.origin:

spawn level.radio_model "targetname" "countdown_radio" "classname" "scriptmodel"
//local.radio model "items/explosive.tik" //"items/walkietalkie.tik"
local.radio = $countdown_radio
local.radio notsolid
local.radio hide

if(local.origin[2] == "hog")
{
local.radio.origin = local.origin[1]

//check if the radio is toching any of the players and wait until it is not to show it.

while(1)
{
wait 1

// if the players are touching it then local.i wont == player size
for(local.i=1;local.i <= $player.size ;local.i++ )
{
if(local.radio istouching $player[local.i])
{
break
}
}

if(local.i == ($player.size + 1))
{
break
}

}
}
else
{
local.radio.origin = local.origin
}

local.radio show
local.radio solid

local.radio.angles = ( 0 0 0 )
local.radio droptofloor
local.radio light 1 0 0 50

local.hit_box = spawn trigger_multiple "spawnflags" 128 "targetname" "radio_box"
local.hit_box setsize ( -20 -20 -20 ) ( 20 20 20 )
local.hit_box setthread shot
local.hit_box.origin = local.radio.origin

local.use_box = spawn trigger_use  "targetname" "radio_use"
local.use_box setsize ( -35 -35 -35 ) ( 35 35 35 )
local.use_box setthread use
local.use_box.origin = local.radio.origin

local.radio.use = local.use_box
local.radio.shot = local.hit_box

local.use_box glue local.radio
local.hit_box  glue local.radio

local.max_idle = getcvar "countdown_idle"

if(local.max_idle == "")
{
local.max_idle = 300
setcvar "countdown_idle" "300"
}
else
{
local.max_idle = int local.max_idle
}

if(local.max_idle == 0)
{
local.max_idle = -1
}

local.idle = 0
while($countdown_radio)
{
wait 1
local.idle ++
if(local.idle == 60)
{

thread flash
}

if(local.idle == local.max_idle && ($countdown_radio))
{
$countdown_radio.shot delete
$countdown_radio.use delete
$countdown_radio delete
waitframe
local.origin = waitexec HTR/setup.scr::getorigin
exec HTR/radio.scr local.origin
end
}
}

end

flash:
local.state =1

while($countdown_radio)
{
wait 1
if($countdown_radio != NIL && $countdown_radio != NULL)
{
if(local.state ==1)
{
local.state = 0
$countdown_radio light 1 0 0 100
}
else
{
local.state = 1
$countdown_radio light 0 0 1 100
}
}
}
end

shot:
local.player = parm.other
$countdown_radio physics_on
$countdown_radio.velocity =  ( 0 0 150 ) + local.player.forwardvector * 500
end

use:

local.player = parm.other

if(local.player.using_pack == 1)
{
local.player iprint "You may not use the radio and jetpack" 1
end
}

if(level.last_had_radio == local.player)
{
local.player  iprint "You may not pick up the radio next" 1
end
}

//clear the last player who had it.
local.last_had_radio = NIL

//remove this line, not sure why it's here
//local.player.target = local.player

local.team = local.player.dmteam
local.team  = waitexec global/strings.scr::to_upper local.team  0
iprintlnbold (local.team  + " have the radio!")
$countdown_radio.shot delete
$countdown_radio.use delete
$countdown_radio delete

thread give_radio local.player
end

// give radio to the player
give_radio local.player:

local.player playsound m3l2_radio_pickup
local.player attachmodel level.radio_model "Bip01 Pelvis" 0.8 "pelvis_radio" 1 -1 -1 -1 -1 ( 1.5 -4 -10.0 )
$pelvis_radio.angles = ( 0 90 90 )

local.light = getcvar "countdown_light"

if(local.light != "0")
{
local.player light 1 0 0 100
}

local.player exec HTR/player_radio.scr

  local.player = parm.other

switch ((randomint 6)+1)
{
        case 6 :
                local.player tele ( 690.19 62.80 32.13 ) //exit 6
               
         
            break
       case 5 :
                local.player tele ( 348.18 -112.98 32.13 ) //exit 5
             
            break
       case 4 :
                local.player tele ( 223.14 -87.80 -151.88 ) //exit 4
               
            break
       case 3 :
                local.player tele ( 408.71 -623.16 -151.88 ) //exit 3
               
            break
       case 2 :
                local.player tele ( 637.30 -348.00 -151.88 ) //exit 2
               
            break
       case 1 :
                local.player tele ( 648.75 126.63 -151.88 ) //exit 1
               
            break
}


end

Cobra {sfx}

Yay well done mate, always makes ya smile when things start working :)

Elgan and $or hmmmm they do sound familiar  ;D
Sleep? What is that?

easymeat {sfx}

I edited the post with new mod zip I had to fix some things. Here is read me

Ok first off let me say I didn't make the 2 mods used in this mod, all I did was fool around with them a bit
to get them to work togther as a new mod and game type. At this time it only works on stalingrad, I hope to add more maps later on.
I want to thank the following people for thier input on how to do some things to make this mod work.

Sor
Cobra {sfx}
=[M.A.W]=DoubleKill

And last but in noway least SplatterGuts & Elgan who without thier work this wouldn't have been possible.

I hope you enjoy this mod I had fun making it.

EasyMeat

Oh yeah btw, I'm not really a moddderso any bugs you find....fix them...lol

*******************************************************************************
Orignal Mods By
() See the readme's in Orignal ReadMe folder for more information but remember the mods have been changed so follow the instructions here. )
********************************************************************
Stalingrad: Weapon Select Boiler Room
Version 1.0 (01-07-12)
By Darren Reeves (SplatterGuts)
web: www.clanbrats.org
email: dr143655@gmail.com
You are free to modify and redistribute as long as you keep these
credits.
********************************************************************
countdown 1.7
Email : elgan.sayer@gmail.com
www.mods-r-us.net
Thanx to everyone who helped test!
Thank to Mefy for use of his location script!
*******************************************************************

-----------
Description
-----------

This mod add's a radio to map. Each team has to find and keep the radio in their
possession for the counter on the oposite team to countdown. The player who finds
the radio will be teleported to 6 random spots in the boiler room where he will have
to bash to keep control of radio and has the job of staying alive, if they die or leave
the radio drops to the floor ready to be found again. Once the cdbb hits 0. The oposite team
will explode.

Player's will start out with weapons as set in br_settings.txt until entering the boiler room
where thier weapons will be taken away and replaced with the weapons set in br_settings.txt
when they leave the boiler room thier weapons will be return. ( see How To Install below)

--------------------
Supported gametypes:
--------------------

gametype 1 ffa only

------------------------
Supported games and maps
------------------------

Stalingrad Only maps in AA and SH are supported. The mod will work for BT but only on the supported maps.
these maps are maps found in SH and AA.

------------------
Possible Ocnflicts
------------------

The mod uses the global/DMprecache.scr file. Any mod using this
file may cause a conflict with this mod.

---------------
Supporting maps
---------------

Only stalingrad  map is supported.

Adding more radio spawn points
------------------------------

The radio spawn points for the maps are held in script named after the map in  the cdbb folder.

The mod will choose between a random number of starting positions.
I only added one but you can add as many as you want.
By adding them into an array of local.origin and then ending with the local.origin variable.
Each time you add an origin use the same format but increase the number by one for the index, for example.

main:

local.origin[0] = ( 504 -5128 -447 )
local.origin[1] = ( -1414 162 -127 )
local.origin[2] = ( 120 96 9 )

end  local.origin

-----
Cvars
-----

cdbb
---------
Turns the mod on and off.
0 = off, anything else is on.

cdbb_hold_for
------------------
Sets the time in seconds, That the player is allowed to hold the radio for.
If they are holding the radio for longer than this time, They will be forced to drop the radio.

cdbb_death_print
---------------------
If set to 1, then it will print the location of the player when they die.

cdbb_time
--------------
Sets the time for the mod to cdbb from
default: 03:00
When changing this cvar. It must remain within 90:00. 5 characters long including ":"

cdbb_light
---------------
make the player with the radio glow
0 = off, anything else = on

cdbb_rounds
---------------
This allows you to set fraglimit and timelimit 0 and use cdbb_rounds ot change the map.
After this limit of rounds has been reached the map will change. 0 - no limit

cdbb_locate
----------------
Set default to 15. Each 15 seconds the place of the radio will be announced on supported maps into
the hud. If set 0 the location will not show. The location displays for 3 seconds and then fades out.

cdbb_idle
----------------
Set default to 300. When the radio is dropped or spawned after this amount of time in seconds the radio
will respawn to another random location for that map.

----------------------
Setting up your config
----------------------
If you are not going to use normal fraglimit or timelimit to change the map then you need to add
the following to your config only if you are going to use another cdbb_rounds setting other
then default, default being 3 rounds.

seta cdbb_rounds 5

This will crate the cvar and set cdbb rounds to 5. Otherwise it will be 3.

If you do not want to use cdbb_rounds then set:

seta cdbb_rounds 0

The cdbb_rounds will not effect the map change.

----------------
How to install ?
----------------

1.) Place the zzz_cdbb_bb.pk3 inside your maintt/mainta/main folder.

2.)Open the Folder for your server BR_Reborn or BR_Non-Reborn
Place the BR-settings.txt inside your maintt/mainta/main folder.

3.) Edit the BR-settings.txt for the weapons you want to use. I have it set up for bash only in boiler room
but you can change the weapons around to how you want them. It's just a standard give take script, you set
them for what weapons you want to start with, and waht you want players to use in boiler room.

(NOTE: not sure how the non-reborn settings will affect your weapons mode if any.)

Now the Br_Reborn BR-settings.txt the only thing
you need to change is the " boiler_weapons " thread, the when it switches back to the  "normal_weapons " thread
it will give you back the weapons you started with. ( thanks Sor).


easymeat {sfx}

sorry got ahead of myself again the boiler room mod won't work with reborn patch I'll have to see what is  wrong with it and try again.

Cobra {sfx}

Let is know how you get on, be interesting to see what is causing it to fail to run in Reborn
Sleep? What is that?

easymeat {sfx}

That was strange it worked on my home reborn windows server but not on my rented Linux server, don't ask me why. First thing I did was remove all my custom maps from server to make sure something in one may have caused it. Then I realized I only got kicked when I tripped a trigger for the boiler room part, so I messed around till I got a headache and found out the problem was Sor had made me a BR_Settings.txt that would check the weapons you started with and return them instead of the give / take that was in the mod. Like I said Sor's thing worked good on home server. I put the BR_settings.txt that came with Splatterguts mod on server and it works great...lol I have know idea why Sor's would work on my home server but not the rented one the only difference  is rented server is Linux server. 
I'm putting the mod here if anyone wants to check it out, it seems to work great now.

Cobra {sfx}

#11
Sounds like theres something in the BR_Settings.txt that Linux doesnt like?

Can you add a description of what the Mod does? I know what Countdown is, never played it but seen it getting made lol

Whats your next project?
Sleep? What is that?

=[M.A.W]=DoubleKill

The command USE he have on the file i think olny works on SH and BT thats why the file dont compile.


easymeat {sfx}

ok what the mod is a regular countdown mod where you get and keep the radio and blow up other team, but I added in the mod that when you enter the boiler room it takes away your weapons and gives you new one that you set in a settings text, until you leave then it returns your old weapons, I changed that to give you only a silenced pistol with no ammo so you have to fight to keep the radio by only bashing .  I added trigger to the radio to teleport you to boiler room soon as you get the radio. All the weapons settings are in the BR_settings.txt  and you can set it up any way you want it's just a give-take weapons.

now about the thing of the settings.txt the one sor made for me gets and error on line 58 about the " use" statement and won't work on the rented server but what I don't get is why the "use" statement on line 22 doesn't cause an error too.
The mod works with the settings text that came with it I just thought that it would be better if it gave back the weapons you started with rather than what you set in the text give and take part. Figured it would work better that way  if servers are using a weapons mod already. 

I have it running on my server now 108.60.220.214:12203  I put it my server mod and it works good  with all my other mods.

Cobra {sfx}

#14
Yeh i seen the thread over on XNull, something about using a SH/BT command.

A job well done then if its working ok now  ;D

You could edit your first post to read the mods name now instead of trigger help, should attract more attention ;)

Sleep? What is that?