Black Windows

Post your scripting questions / solutions here

Moderator: Moderators

sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

alrighty so tried again with something different put boards in windows for effect. made them notsolid and did not put nodamage because they are for looks. built a clip on outside of the windows. see SS


Image

Code: Select all

	spawn script_object "targetname" "blocker1" 
	$blocker1.origin = ( -2700 -2207 345 )
	$blocker1 setsize ( 0 0 -70 ) ( 571 5 70 )
	$blocker1 solid
	$blocker1 nodamage

	spawn script_object "targetname" "blocker2" 
	$blocker2.origin = ( -2129 -2207 345 )
	$blocker2 setsize ( 0 0 -70 ) ( 5 425 70 )
	$blocker2 solid
	$blocker2 nodamage
Then started map up and went to outside and shot dead center of the windows and saw and heard glass breaking. so bullets are still getting through.

Note the clips were just for testing purpose. I know the sizes are not exact but did not want to waste alot time if they were going to fail again
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

Somewhere my clips are disappearing. When start the game I went straight to console and load the game like a single player map. Could see the clips like the SS above. As soon as I start a lan game up the clips disappear. I have no clue why this is happening.

Can someone check it out for me?
download
http://www.hitp.clanservers.com/downloa ... indows.zip
Herr Klugscheisser
Lance Corporal
Posts: 21
Joined: Thu Mar 17, 2005 1:14 pm

Post by Herr Klugscheisser »

In your file you have:

Code: Select all

//clips for black windows

	spawn script_origin "targetname" "blocker1" 
	$blocker1.origin = ( -2700 -2207 345 )
	$blocker1 setsize ( 0 0 -70 ) ( 571 5 70 )
	$blocker1 solid
	$blocker1 nodamage

	spawn script_origin "targetname" "blocker2" 
	$blocker2.origin = ( -2129 -2207 345 )
	$blocker2 setsize ( 0 0 -70 ) ( 5 425 70 )
	$blocker2 solid
	$blocker2 nodamage

But above you have them as script_object. I always make them a script_object, but I'll try your script when I get a chance.
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

ja have tested it both ways and it failed both ways on me. herr if check it out that would be great. Like said earlier tried the guys pre made ones in TMT forum and they didn't work so thinking it is where i am excuting them at. I went barbones into the game. so nothing else was interfering with it.
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

When I use sandbags they seem to stop all bullets, I don't know why yours won't work:

Code: Select all

	local.sandbags = makeArray
	( -65 -90 0 ) ( 0 90 0 ) "static/sandbag_link_topcap.tik"
	( 0 -90 0 ) ( 0 90 0 ) "static/sandbag_link_main.tik"
	( 70 -95 0 ) ( 0 -90 0 ) "static/sandbag_link_rightbend.tik"
	( 70 -50 0 ) ( 0 0 0 ) "static/sandbag_link_main.tik"
	( 70 25 0 ) ( 0 0 0 ) "static/sandbag_link_main.tik"
	( 70 95 0 ) ( 0 90 0 ) "static/sandbag_link_leftbend.tik"
	( 0 90 0 ) ( 0 -90 0 ) "static/sandbag_link_main.tik"
	( -70 90 0 ) ( 0 -270 0 ) "static/sandbag_link_topcap.tik"
      endArray

	for (local.i = 1; local.i <= local.sandbags.size; local.i++)
	{
		local.s = spawn script_model model local.sandbags[local.i][3] "targetname" "sandbags"
		local.s.origin = local.origin + local.sandbags[local.i][1]
		local.s.angles = local.sandbags[local.i][2]
		local.s solid
		local.s nodamage
	}
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

ja works fine using it in single player maps made multiplayer. Even can see the clip when I load it like a single player game but as soon as load it up as Lan it is not there. Everything else that I have spawned is except for that.
Herr Klugscheisser
Lance Corporal
Posts: 21
Joined: Thu Mar 17, 2005 1:14 pm

Post by Herr Klugscheisser »

Not sure either. I tried a couple combinations and I could still shoot the glass. His clip should be far enough away but yet the "bullet" keeps going. Strange indeed.
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

Can not believe I keep trying things that end up causing so much heartache.
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Maybe making the clip a bit thicker would help? I'm running out of ideas...

Or perhaps try a rebound method. Spawn a trigger_multiple, covering the black window and set its spawnflags to 128. The bullets will go through be we will know who shot them and we can give them a shock.

Code: Select all

local.trigger = spawn trigger_multiple "spawnflags" "128"
local.trigger.origin = local.origin
local.trigger setsize ( -40 -40 -5 ) ( 40 40 5)
while(1)
{
      local.trigger waittill trigger
      local.player = parm.other
      local.player hurt 25
      waitframe
}
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

k will try that if doesn't work only thing i can think is to spawn regular size lids and patch the windows up. will try

update works like a charm that way guess i will work with that. btw, any chance of getting u to release your spawn protection I saw on your server the other day SOR?
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I have an idea for an alternative method. Why not just modify the BSP to remove the glass properties from those brushes? I could write a little program for that.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

kind of like the modified bsp i found for crossroads. if so that would be sweet!!! but guessing that would cause problems for all the blacks windows that lead to nowhere wouldn't it?


btw, you guys ever need test server plz let me know. mine is used entirely for that.
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

I don't think hex-edits to the bsp is serverside. I read about it on tmt, lamron tried to remove the sun, but his clients couldn't see any change.

Sdall, I'm glad it works, but you could even improve the rebound method. Let's say someone is shooting wildly on the streets and hits one of those windows, he'll lose health when he didn't do anything wrong. You could add a check that only the person standing at the 'abusive'-side of the window only get's shocked.

The easiest way would be to just check the z value. Enter "whereami 1" in the console and go to the building on the floor of the black window. Write down the last recorded Z value. Then check for:

Code: Select all

if (local.player.origin[2] > (local.z - 1) )
local.z being the value you wrote down. Of course, each trigger must have its own local.z value.

A more accurate method would be to record the highest and lowest coords of the room (always in an upper and lower corner). Then check each sequentially to see if the player is located within the room.
I use it a lot, here's an example:

Code: Select all

local.go = 0

if(local.player.origin[0] <= level.treasury_max[0] && level.treasury_min[0] <= local.player.origin[0])
	local.go++
if(local.player.origin[1] <= level.treasury_max[1] && level.treasury_min[1] <= local.player.origin[1])
	local.go++
if(local.player.origin[2] <= level.treasury_max[2] && level.treasury_min[2] <= local.player.origin[2])
	local.go++

	if (local.go == 3)
	{
	          // do stuff here
	}

Code: Select all

	level.treasury_min = ( -1670 -1551 -77 )
	level.treasury_max = ( -1330 -1067 90 )


As for the spawn protection; it is tangled in my spawn detection and that's also tangled in many other things. The script itself is not that "wow":

Code: Select all

main:

	if(self == NULL)
		end

	self nodamage

	local.team = self.dmteam

	local.wait = level.AIR["spawn_protect_sec"]
	self iprint "---Protection on!"

	while(local.wait >= 0.000)
	{
		if (self.dmteam != local.team || self.status != "alive")
		{
			break
		}
		
		local.wait -= 0.1
		wait 0.1
	}

	if (self)
	{
		self iprint "---Protection off!"
		self takedamage
	}
end
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

$oldier Of Ra wrote:I don't think hex-edits to the bsp is serverside. I read about it on tmt, lamron tried to remove the sun, but his clients couldn't see any change.
Yes they are server-side, mate. :) I know what I'm talking about. Some parts of the BSP are read only by the server, some by the client, some by both. The reason the sun would stay is because the server doesn't give a flying fish about it, it's just eye-candy for the client. Collision detection, however, is handled exclusively by the server (except for lag smooting on the client part), due to the authoritative server model that Quake engine utilizes.

It will work. And no, it won't cause problems on all black windows - the method allows to disable material properties on particular sides of particular brushes that we choose. When compiling a map, q3map bakes the surface properties into the BSP as bitflags, it doesn't use shaders for them at all.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
sdlall
Sergeant Major
Posts: 110
Joined: Tue Mar 24, 2009 11:41 pm

Post by sdlall »

Thanks SOR. I have seen hex bsp for crossroads windows that allow you to jump out them after they are broke. Would be something to see a destroyed village one. would only maybe nee to be those 3 problem windows close to allied spawn and maybe the one that is tank street in the house with the stairs and ladder because that 1 is see through from one side and black on the other. Would this work on the windows for Remegan. Village and Remegan would be the only maps I would care about.
Post Reply