Page 1 of 1
Black light
Posted: Fri Jul 26, 2002 4:27 am
by tltrude
The underside of my riverboat's cabin roof keeps coming out black no matter which texture I use. I have replaced the brush twice and there are no overlaps. I can't put a light in there because the boat moves. The underside of other things on the map come out dark, but not black. The top door trim underside face is not black but the top window trim underside faces are (there's no glass in the windows).
When compilling, I get four warnings saying that a leaf portal can see into a leaf. Is this black light problem what it is talking about? Any help you can give to fix it would be great!!!

Posted: Fri Jul 26, 2002 5:29 am
by Moal
there is a texture you can put it in that is light
it's in light/ambientwhite
you can hit n and give it a key/value light 75 ( or what ever)
texture
Posted: Sat Jul 27, 2002 3:02 am
by tltrude
Using that texture on the bottom of the roof makes the surface vanish--like no draw.
Posted: Sat Jul 27, 2002 6:24 am
by Moal
not sure what to tell you then
if I get a chance I'll do some testing in the next few days
will let you know
Posted: Sat Jul 27, 2002 5:22 pm
by Wombat
pity you can't glue a light there
is your boat a script_model?
if so
then put your light where you want in the boat, set targetname to boatlight ( for example )
set targetname for boat to boat ( for example )
then in your script add before prespawn. etc...
$boatlight glue $boat
this will glue them together, and then when one moves , the other will follow ?
I hope.
It works for me on scripted rocks ( script_model and a trigger_multiple)
rock moves and when it hits you, you die......
fixed
Posted: Sun Jul 28, 2002 5:47 am
by tltrude
Well thanks guys, but I fixed it on my own. I had to give the roof and top window trim new target names and then bind them to the boat.
I don't know how to make a script model without a model. It is a script_object and it works great now. I am calling the map "Suez" for now and it looks better everyday!!!
I'm using waypoints to move the two power boats, but scripting the time between waypoints is a pain--speeds up and slow down. Is there a way to set a constant speed no matter how far the waypoints are apart?
Posted: Sun Jul 28, 2002 6:26 pm
by NathanielPT
Hmm. Yes there is, how good is your trig and geometry? You would have to create vectors and so forth, and set the time based upon those calculations. I know you can do it in MOH, but I don't know how. Let me mess around a couple of hours and maybe I can figure it out.
Posted: Sun Jul 28, 2002 9:56 pm
by NathanielPT
As I promised here it is, and its easier than I thought:
To achieve a
constant speed we need several formulas.
speed = distance / time
From which we derive:
distance = speed * time
time = distance / speed
Of those two the later is the one we are most concerned with. Now lets take a look at the problem we are trying to solve. We have several waypoints and they are not all the same distance appart. But we want a boat to travel between them at a constant speed regardless of the distance between them. Now, we must supply to variables, #1 the speed at which we want to move (in quake units per second), #2 the distance between waypoints. The speed is easy, we just pick it. The distance is a little harder to figure. Think back to your geometry, now is when you wished you had paid attention, or you are glad that you did. To calculate the distance between to points on a 2-dimensional plane is simple, (read
^x as "raised to x-th power"
distance^2=(x1-x2)^2 + (y1-y2)^2. In a 3-dimensional plane we just add a 3rd part
distance^2=(x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2.
Now I could go on about how to access parts of vectors and all, but there is an easier way. It is called
vector_length. This handy little function takes a vector, the difference or sum of two origins, and returns the distance between the points (yes I know this is not the proper terminology for vectors, but it is clearer for the current purposes).
Great, now we have the speed and the distance, we just plug them into our formula
time = distance / speed, and "wa la" (I know my French stinks) we get the answer, or the time it will take two travel between the two points. Below is the mohaa script code to do what I've talked about.
Code: Select all
move_the_boat:
// The speed our boat will travel at in quake units
// per second, qps
local.speed=50
// $way1 -- our first waypoint
// $way2 -- our second waypoint
// Get the distance between them
local.dis=vector_length($way1.origin - $way2.origin)
// Calculate the time
local.time=local.dis/local.speed
$boat time local.time
// Tell the boat where to goto
$boat moveto $way2
// Move the boat. There are two ways to do this.
// 1) $boat waitmove
// This stops script execution
// till the boat is done moving
// 2) $boat move
// Continues with script exection
// while the $boat moves
$boat move
end
I hope this helps! If something isn't clear, let me know.
speed
Posted: Mon Jul 29, 2002 12:53 am
by tltrude
I will try your solution, but first I am going to try replacing all the "time" lines with "speed" lines--now that I know that the number is quake units per second. It seems to me that if I set "$iverboat speed 50", it will stay at that speed all the time.
Post script: Hey, it worked!!! All I had to do was put "$riverboat speed 150" in the preperation thread and the boat runs at that speed (150 gps)all the time. I took out all the time lines between waypoints. Speed does not work for rotation however, so I had to put time values in for when it turns around for the return trip.
Sorry, you spent two hours doing the trig, but I think it is already built into the game.