![]() |
Quote:
The best place for the MissionNumberListener is a method that called at the begin of a Mission. Normaly i use OnBattleStarted() Code:
public override void OnBattleStarted() Quote:
Code:
Random ZufaelligeMission = new Random(); |
ok tried it, but i still dont know when and how i use those parts....
this is what i have so far.... PHP Code:
after xx seconds i want the game to load one mission ,selected randomly out of 4 submissions. i also want the He's loaded with the submission to be destroyed after the xx seconds, like the ones from the main mission. and i want the game to repeat that process, so that every xx seconds a new mission is loaded randomly.....so that the mission can run forever |
Script modified (added a timer) and corrected:
Code:
using System; |
I did not try using Stopwatch() yet. Is it a part of C# or CloD only?
Can it be used inside the onTickGame method only or in any other method as well? If it is placed inside the onTickGame method won't the "if" statement checked every tick, i.e. 30 times a second? |
Quote:
you need to include the namespace System.Diagnostics for usage. For the query time can be for example (MissionTimer1 is the stop watch) MissionTimer1.Elapsed.Days MissionTimer1.Elapsed.Hours MissionTimer1.Elapsed.Minutes MissionTimer1.Elapsed.Seconds MissionTimer1.Elapsed.Milliseconds MissionTimer1.Elapsed.Ticks MissionTimer1.Elapsed.TotalDays MissionTimer1.Elapsed.TotalHours MissionTimer1.Elapsed.TotalMinutes MissionTimer1.Elapsed.TotalSeconds MissionTimer1.Elapsed.TotalMilliseconds There is a difference between for example Minutes and TotalMinutes etc.: MissionTimer1.Elapsed.Minutes has e.g. the range -59 to 59 minutes, only indicates the minute proportion of the total time. at 2h 43m 12s would be the 43rd MissionTimer1.Elapsed.TotalMinutes provides e.g. the total number of minutes since launch. 2h 43m 12s min at 163.12 then. Methods MissionTimer1.Start () / / Starts the timer MissionTimer1.Stop () / / Pauses the timer can be resume with Start () MissionTimer1.Restart () / / Starts the timer at 0 newly MissionTimer1.Reset () / / Resets the timer to 0 and stops the time measurement MissionTimer1.IsRunning / / bool indicates whether the timer is running (true) or not (false) Quote:
You can for example measure the time between two events etc. You need to declare a Stopwatch global and start it once, normaly OnBattleStarted(). Then you can use it in every way you like. Quote:
Don't know whats faster, a modulo calculation or a simple stopwatch request. But stopwatch is much more accurate. ;) |
Thank you very much for great explanation! I will be using it in the future.
Currently I am struggling with triggers for my R2 and R3 mission and hope you can advise what I should look at. I am loading 2 submissions 1_E3_air0.mis , 1_E3_air1.mis randomly. 2nd one is a copied 1st one with aircraft changed from Wellington to Blenheim. Name of airgroup remained the same. Triggers in submissions are called 1_E3_air and 1_E3_air. Same name now but I tried also checking 1_E3_air0 and 1_E3_air1 in a loop with the same result. The trigger was created in the 1st submission and copied to the 2nd in a notepad. 1_E3_air TPassThrough 1 gb02.07 53073 33421 2000 1_E3_air TPassThrough 1 gb02.07 53073 33421 2000 As a result, the 1st submission trigger does not work at all. The second submission trigger works 2 or 5 times (maybe depending on number of aircraft in the group?) Questions: Why the trigger in 1st submission may not wark? In which cases && active) check must be added? When GamePlay.gpGetTrigger(shortName).Enable = false; must be edded? Naryv does not use it in some of his examples. How to make 2nd trigger "work" only once per mission? Can all triggers have the same name? When I copy a mission file should I change a name of an airgroup in it by hand? If I include all the triggers into the host-mission only would they trigger when submission airgroups pass-through? Code:
public override void OnTrigger(int missionNumber, string shortName, bool active) |
thx Kodiak!you are really helpful and supportive not only for me, but i think for the whole community...i think with every question i ask, this thread gains worth...
this script works, and finally i have what i wanted to achieve, a infinite bomb raid on london...i have 50 submissions, each with 18 He's, and in every mission they bomb another area of the city...so after playing an hour, the center of london resembles Dresden in 45.combined with massive AAA this mission really looks nice... however now i want to have british fighters as well in that mission... but i will try that for myself first, and if i run into trouble, i'm sure your knowledge will once again be useful...thx again Kodiak.....if this thread was more structured, it could serve as a knowledge-base. |
@Ataros:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
1 Attachment(s)
Quote:
|
ok i tried to combine your last script with the one where the same airgroup gets respawned everytime you shot a certain amount down....
doesnt work... PHP Code:
|
All times are GMT. The time now is 03:01 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.