Page 1 of 1
sighttrace command and other
Posted: Wed Sep 24, 2003 10:37 pm
by Tropheus
Hello everybody !
Sorry for this stupid questions. but i have seen on bjarne tutorial this sighttrace command. But i don't anderstand what it means. I have looked at your others topics, but i didn't anderstand anymore.
If somebody could explain me how can i use it. what are its effects on game.
Secondly
when bjarne speak about self object in his tutorial.
Automatically started scripts
self is NULL for level scripts. Self is the character for animation scripts.
How do you think i can translate "character" in french ?
Thanks for your answers.
Tropheus
Posted: Wed Sep 24, 2003 11:07 pm
by Alcoholic
Hmm, don't know french, but character is like the guy we are talking about, for example, if I made a story, and I was the leader of a group of men in the book, I could be the 'main' character.
Posted: Thu Sep 25, 2003 12:10 am
by nuggets
sighttrace follows a players position
when using self it talks about the entity using the thread
so if
$player thread test
test:
self action //not a real command
the $player (who is self) would perform the action
Posted: Thu Sep 25, 2003 5:13 am
by The Jackal
So what would be the difference, if I were to do it like this:
Code: Select all
$player thread test
test:
$player action
Wouldn't it be the same? Why would SELF be needed?
PLease expand upon this somemore.
self
Posted: Thu Sep 25, 2003 5:26 am
by tltrude
"self" is used as a common name for multiple entities. You would only need to make one thread/script instead of many. It is used a lot in the global scripts.
In your little example, you can leave the first "$player" out and it would still work. But, what if you wanted more than one targetnamed entity (character) to do that same action?
Posted: Thu Sep 25, 2003 5:56 am
by jv_map
The sighttrace command is used to check visibility between two given positions, and will return 1 when the first position can be seen from the second (or vice versa

) and will return 0 otherwise. The final parameter sets the number of entities ignored in the sighttrace (awkward

).
Anyway, here is a usage example:
Code: Select all
local.cansee = sighttrace (0 0 0) $player.origin 128
if(local.cansee == 1)
iprintln "Player cansee (0 0 0) !"
Or:
Code: Select all
if(sighttrace (0 0 0) $player.origin 128)
iprintln "Player cansee (0 0 0) !"
Posted: Thu Sep 25, 2003 7:21 pm
by Tropheus
Hi everybody !
Thanks a lot for your answers.
For the "self" expression i understand.
it looks like a variable wich can works for several entity as differents elevators working with the same thread.
For "character" is the "AI german soldier for example" because in french, you can translate it by "alphanumeric signe" as "a" "b" "1" and so on.
But for the sighttrace commande it looks like very difficult to use.
In fact i think to understand that is the way between 2 positions. the first entity can seing another one!
Is it the command used in normandy map to order the plane to bomb the flak when you get the binoculars?
But what is the real interest to use this command ?
Do you use it in multiplayer or solo maps ?
How do you define the number of entities ignored ???
Is it really an important command ???
Sorry for these stupid questions ?
Tropheus
Tropheus
Posted: Fri Sep 26, 2003 6:08 am
by jv_map
Binoculars work a little different but internally use the same concept basically.
You can for example use sighttrace when you're scripting a tank and want to know whether the tank can hit you or not.
Anyway it's generally better to decide what you want to script first and then find a suitable command, rather than the other way around
