Just that, what is the tick of a game?
Is it MP related for the battle ending or something completely different that applies to SP?
Just that, what is the tick of a game?
Is it MP related for the battle ending or something completely different that applies to SP?
I am Yo-Yo not YoYo (that's someone else)
That OnTickGame is called about 33 times per second while the battle is running. If you are writing your own code you will often be calling it from there.
Ah interesting, thanks.
I am Yo-Yo not YoYo (that's someone else)
Enclosed please find a little example ...
~V~
Code:using System; using maddox.game; using maddox.game.world; public class Mission : AMission { public override void OnTickGame() { double ElapsedSeconds; if (Time.tickCounter() == 334) { ElapsedSeconds = Time.TicksToSecs(Time.tickCounter()); GamePlay.gpLogServer(null, "{0} ticks are {1} seconds\n", new object[] { Time.tickCounter(), ElapsedSeconds }); } if (Time.tickCounter() == 667) { ElapsedSeconds = Time.TicksToSecs(Time.tickCounter()); GamePlay.gpLogServer(null, "{0} ticks are {1} seconds\n", new object[] { Time.tickCounter(), ElapsedSeconds }); } if (Time.tickCounter() == 1000) { ElapsedSeconds = Time.TicksToSecs(Time.tickCounter()); GamePlay.gpLogServer(null, "{0} ticks are {1} seconds\n", new object[] { Time.tickCounter(), ElapsedSeconds }); } } }
Enclosed please find another example ...
~V~
Code:using System; using maddox.game; using maddox.game.world; using maddox.GP; using System.Collections.Generic; public class Mission : AMission { private double nextMsgTime = 0; public override void OnTickGame() { { base.OnTickGame(); if (Time.current() > nextMsgTime) { nextMsgTime = Time.current() + 10.0; // 10 seconds to next message // Leave this in if you want to test a timer //GamePlay.gpHUDLogCenter("Time elapsed (in seconds) = " + Time.current() + // ", next message will be at " + nextMsgTime); if (GamePlay.gpPlayer() != null) // check if we have a player. { if (GamePlay.gpPlayer().Place() != null) { Player me = GamePlay.gpPlayer(); AiActor where = me.Place(); Point3d pos = me.Place().Pos(); GamePlay.gpHUDLogCenter("Where? x:" + ((int)pos.x).ToString() + " y: " + ((int)pos.y).ToString() + " z: " + ((int)pos.z).ToString() ); } } } } } }
I am Yo-Yo not YoYo (that's someone else)
Here you will find a bunch of inspiration and help ....
Official 1C Company forum > FMB, Mission & Campaign builder Discussions
FMB, Mission & Campaign builder Discussions > Scripts collection
~V~
PS: while browsing around there you should be listening to Richard Strauss, Op.30![]()
Last edited by varrattu; Sep-16-2020 at 08:04.
Bookmarks