Linkman226
#anarchy
- Joined
- Sep 14, 2007
- Messages
- 2,493
In the API, under the CyMessageControl class, you find this:
So, whenever this method is invoked, it causes a ModNetMessage game event that can be detected in the Event Manager/Handler:
All you basically need to do, is to portion the instructions for what you wanna do into the five data values. Passing a CyUnit instance could, for example be expressed as the PlayerType and the Unit ID. Because then you can rebuild the object with CyPlayer.getUnit(). If you enumerate the Python effects in your mod you can use another data slot as the identifier for what you wanna do with the rest of the values. (Like identifying the PlayerType and the Unit ID as a newly created unit.)Code:def onModNetMessage(self, argsList): 'Called whenever CyMessageControl().sendModNetMessage() is called - this is all for you modders!' iData1, iData2, iData3, iData4, iData5 = argsList
The question is if you can pass other than integer values in a Mod Net Message. Because being able to pass arrays of values would be far more potent!
edit; Man, fiddling with this sort of thing is exactly what I like about programming. Too bad I don't have the time go try this stuff myself!
Oh cool, Baldyr. That's neat. I'll think certainly consider a Synthesis:Mp later then.