Invisibull Posted March 1, 2013 Posted March 1, 2013 Hi - I'm making a dogfight scenario where the side who can stay within a zone for X amount of time wins. I'd like it to be cumulative so either side can enter and leave the zone numerous times but their total time within the zone is always being calculated. It would also be a plus if i can show players updates for time in zone in a useful way. Any ideas would be greatly appreciated. Regards, Bull i9 9900k - GTX 2080 Ti - MSI Z87 GD65 Mobo - 64GB HyperX Predator RGB DDR4 3200MHz - Win10 64 bit - TM Warthog w FSSB R3 mod - TrackIr 5.
Grimes Posted March 2, 2013 Posted March 2, 2013 Scripting! Use the following: Once>Time More than 1> Do Script Type this into the do script box: redscore = 0 bluescore = 0 With the remaining triggers use: Continuous>Part of Red Coalition in Zone>Do Script( redscore = redscore + 1) Continuous>Part of BlueCoalition in Zone>Do Script( bluescore = bluescore + 1) Continuous>Time More than 1>Do Script display = {} display[#display + 1] = 'Red team time in zone: ' display[#display + 1] = redscore display[#display + 1] = '\n' display[#display + 1] = 'Blue team time in zone: ' display[#display + 1] = bluescore trigger.action.outText(table.concat(display), 2) The time will be displayed in seconds only. If you want it to display minutes also you will have to do a little extra work to convert it to minutes, but its not that bad. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Invisibull Posted March 2, 2013 Author Posted March 2, 2013 Hi Grimes, thanks for your reply. I've never worked with scripting before and so I have no idea where that code goes, and would love to display in minutes/seconds but i have no idea what i'd change to do so. i9 9900k - GTX 2080 Ti - MSI Z87 GD65 Mobo - 64GB HyperX Predator RGB DDR4 3200MHz - Win10 64 bit - TM Warthog w FSSB R3 mod - TrackIr 5.
Grimes Posted March 2, 2013 Posted March 2, 2013 Trigger action "Do Script" has a little text box and that is where you copy and paste the scripts to. I'll whip up a little mission real fast as a demo. Will post it later. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Grimes Posted March 2, 2013 Posted March 2, 2013 See attached file. I've set it up pretty much exactly as described above. The only difference is I added a function that converts the time in seconds to display in m:ss format.Zone_Time_count_demo.miz 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Invisibull Posted March 2, 2013 Author Posted March 2, 2013 Grimes, thanks a bunch. I'll check this out soon. +1 i9 9900k - GTX 2080 Ti - MSI Z87 GD65 Mobo - 64GB HyperX Predator RGB DDR4 3200MHz - Win10 64 bit - TM Warthog w FSSB R3 mod - TrackIr 5.
Recommended Posts