View Single Post
  #18  
Old 05-21-2012, 06:08 PM
moggel moggel is offline
Approved Member
 
Join Date: Mar 2011
Posts: 70
Default

Quote:
Originally Posted by FG28_Kodiak View Post
There is no way to get the MissionfileName from a script (i am looking for it too), via CloDo - API
It would be possible (i think) if we can create Addins for Multiplayer, to get the current directory.
IGame:
gameInterface.ToFileSystemPath(..)
Sounds interesting. Where can I obtain IGame objects? I've found the type and apparently it inherits from IGamePlay. If I set a breakpoint in OnTickGame and cast it to IGame I do get an object but the IGame.BattleScriptFileName property is always null. I performed the test in SP mode. I then tried doing the same from OnBattleStarted() and OnBattleInit() but those never gets called.

I then performed the exact same test running a server thinking that maybe a "battle" is what gets started when you type "battle start" in the server console but ... no.

When are those methods called anyway?

By the way: I think we should set up a scripting WIKI...
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate
Reply With Quote