Page 2 of 4
Posted: Thu Jul 31, 2003 7:36 am
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).
Posted: Thu Jul 31, 2003 11:42 am
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
Posted: Thu Jul 31, 2003 1:55 pm
by Bjarne BZR
Posted: Fri Aug 01, 2003 4:16 pm
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?
Posted: Fri Aug 01, 2003 5:23 pm
by jv_map
I don't think so, but you could try setting level.script to something you prefer

Posted: Fri Aug 01, 2003 5:51 pm
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?

Posted: Fri Aug 01, 2003 6:00 pm
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?

Who knows, actually I think it's not used at all

Posted: Fri Aug 01, 2003 11:02 pm
by Bjarne BZR
Ehhh... OK.

Posted: Sat Aug 02, 2003 1:58 am
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
Posted: Sat Aug 02, 2003 6:01 am
by jv_map
Did you try making a log?

Posted: Sat Aug 02, 2003 1:18 pm
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.
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).
Posted: Sat Aug 02, 2003 4:53 pm
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??

Posted: Sat Aug 02, 2003 6:02 pm
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

)
Posted: Sat Aug 02, 2003 11:07 pm
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

But a recompile is on the top of my list...
Posted: Sun Aug 03, 2003 12:32 am
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...
