Jump to content
loopdk

Moving targets on rails

Recommended Posts

Hey guys .

 

I am trying to build a new range with moving targets....

 

I need somthing like this

https://www.gruppe-w.de/forum/viewthread.php?thread_id=2235&pid=27160

 

THe problem is i cant finde the old test mission and i dont speak German og google translate suks...

 

And this is wery old so i was hoping for a new an smarter  way...

 

 

eny help?

  • Like 1

Share this post


Link to post
Share on other sites

The problem with this script is that it uses a small position change many times a second:

while {(_aktw > 0) && !(_target getVariable "_down")} do {
	_aktw = _aktw - _dw;
	_target setPos (_frstRail modelToWorld [(_aktW - 0.15),0,-0.10]);
	sleep 0.01;
 
};

This will lead to undesired behaviour when playing on a server as the targets will be teleporting over the rail for everyone else who hasn't executed the script (is not local). The script is not MP compatible, as Steffi states:

Quote

Ein Großer Teil ist geschafft, es läuft ganz passable im Singleplayer. Nun Stehe ich vor der Hürde das Ganze auf dem ded. Server zum laufen zu kriegen. Knackpunkt ist offensichtlich das ewig nervige Thema Lokalität. Das ganze Konstrukt, da über die Intit-Zeile des ersten Schienenstücks ausgeführt läuft natürlich auf jedem Client, und bei vielen Spielern hat man dann natürlich mehrere Targets, die auf den schienen hin und her fahren, was zwar sehr witzig aussieht, aber nicht wirklich seinen Zweck erfüllt. Noch schöner wird es wahrscheinlich später bei den "Hit"-Event Handlern werden. Ein einfaches "if (!isServer ) exitWith {};" hat das Problem nicht behoben.

Translated:

Quote

A big part is done, it runs quite smoothly in singleplayer. Now I have to get the whole thing working on the dedicated server. The problem is obviously the annonying locality. The whole build, because it is executed from the init line of the first rail runs on every client, and with many player you get more targets, that are sliding around on the tracks, which looks quite funny but is not what you want. It will probably get even better when it comes to the "Hit"-Evenhandlers. A simple "if (!isServer ) exitWith {};" didn't solve the problem.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×