A binocular scouting idea!

Post your scripting questions / solutions here

Moderator: Moderators

Cool idea?

Yea! Wicked!
6
67%
No! Sucks!
2
22%
Well, sounds OK... but what use is it? Why bother?
1
11%
 
Total votes: 9

jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Alcoholic wrote:what does normalizing vectors do? also, what about converting vectors to angles? i mean, a vector is like 2 8 64, and an angle could also be, 2 8 64, so why do you use vector_toangles?
A normalized vector is a vector with length 1. This means that for any normalized vector the following is true: x^2 + y^2 + z^2 = 1

Vectors are often easier to work with than angles, that's why I converted them.

An angle of (0 90 0) for example would have vector (0 1 0).
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Aight!

Now you can try out this slamming new feature in the Release candidate 1 version of Vemork approach obj!

Direct link: http://www.planetmedalofhonor.com/rjuka ... proach_obj
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

I forgot you guys like screenshots:
http://www.planetmedalofhonor.com/rjuka ... t_mod.html
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Oh, one more thing jv (or anyone else)... I'm thinking of converting this into a server mod... Problem is that the pressing of "Fire" with the binoculars up calls clickitem_fail in the *.scr of the loaded map... is there a way to catch this without editing the maps *.scr file? Basically I want to be able to put the file "rjukanproject_scout.pk3 in main to give the server the scouting ability, without editing any more files... can that be done?
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I don't think so, but you could try setting level.script to something you prefer ;)
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Will that change the script that is called by the binocular "fire"? Wont that f**k up other things and start new problems? :cry:
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Bjarne BZR wrote:Will that change the script that is called by the binocular "fire"? Wont that f**k up other things and start new problems? :cry:
Who knows, actually I think it's not used at all :?
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Ehhh... OK.

:shock:

:D
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Another thing: Some servers crash after the first round of "Vemork approach" ( With the scout mod ). That is as soon as someone has won.
It only dives if developer and logfile are both set to 0, so I have trouble pin pointing the problem...

Is there anything hostile in this code that could in any way cause a server crash?

Code: Select all

/******************************************************************
 * Give the players the ability to "tag" enemy with the binoculars.
 */
clickitem_fail:
	local.fwd_vec = angles_toforward self.viewangles
	local.start = self gettagposition "Bip01 Head"
	local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * $world.farplane) 0
	local.ent = spawn script_origin origin local.hit_location

	println "Binocular target: " local.hit_location
	if ( $player.size > 1 )
	{
		for(local.i = 1; local.i <= $player.size; local.i++)
		{
			local.player = $player[local.i]
			if(self != local.player)
			{
				if(self.dmteam != local.player.dmteam)
				{
					if(local.ent isTouching local.player)
					{
						self iprint "You have tagged an enemy soldier!" 1
						local.player thread light_up
						break
					}
				}
			}
		}
	}
	local.ent immediateremove // do it! do it now! :)
end

/******************************************************************
 * Light up a player as a chrismas tree ( if not already lit ).
 */
light_up:
	println "Player tagged: " self "(Glow-state=" self.glowing ")"
	if( self.glowing != 1 )
	{
		if ( self.dmteam == allies )
		{
			self light 0.0 0.0 1.0 300
		}
		else
		{
			if ( self.dmteam == axis )
			{
				self light 1.0 0.0 0.0 300
			}
			else
			{
				self light 0.0 1.0 0.0 300
			}
		}
		self iprint "You have been sighted by an enemy scout!" 1
		self lightOn
		self.glowing = 1
		wait 10
		self lightOff
		self.glowing = 0
	}
end
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Did you try making a log? :?
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Bjarne BZR wrote:It only dives if developer and logfile are both set to 0, so I have trouble pin pointing the problem...
Dives=crashes

I did manage to crash it with logging on once but the bastard MOHAA buffers the log writing so the last ( most important ) lines has a tendency not to be in the log. :evil:

The last lines was

Code: Select all

Client 8 connecting with 50 challenge ping
Shifty is preparing for deployment
broadcast: print "Shifty disconnected\n"
------ Server Initialization ------
Server: obj/obj_vemork_approach
the 2 last lines indicate failure at the mapstart, not the previous map end ( if that helps).
Admin .MAP Forums
Image
Head above heels.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

jv_map wrote:
Alcoholic wrote:what does normalizing vectors do? also, what about converting vectors to angles? i mean, a vector is like 2 8 64, and an angle could also be, 2 8 64, so why do you use vector_toangles?
A normalized vector is a vector with length 1. This means that for any normalized vector the following is true: x^2 + y^2 + z^2 = 1

Vectors are often easier to work with than angles, that's why I converted them.

An angle of (0 90 0) for example would have vector (0 1 0).

so does that mean if you add x y and z it equals 1?? :?:
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Alcoholic wrote:so does that mean if you add x y and z it equals 1?? :?:
No, it means if you calculate x * x + y * y + z * z it will equal 1 * 1 = 1 :) (= nothing more spectacular than good old Pythagoras ;))
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Actually, after some testing I've realized that its not the scout mod that causes the failure: its the map itself... Still dont know why however :cry: But a recompile is on the top of my list...
Admin .MAP Forums
Image
Head above heels.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

jv_map wrote:
Alcoholic wrote:so does that mean if you add x y and z it equals 1?? :?:
No, it means if you calculate x * x + y * y + z * z it will equal 1 * 1 = 1 :) (= nothing more spectacular than good old Pythagoras ;))
oh i didnt know you meant "x squared".. i didnt know what the ^ meant, i just see it in my console alot... :oops:
Post Reply