samedi 25 juillet 2015

Couple of mutator coding questions

Hello,

I am new to UE3 mutator coding, but with UE3 online docs and some posts here on this forum, I think I was able to figure out the basics. Atm, I have couple of questions. Please see example code below.


class MyMutator extends Mutator;

simulated function PreBeginPlay()
{

local ROMapInfo MyMapInfo;
MyMapInfo = ROMapInfo(WorldInfo.GetMapInfo());

//do something with MyMapInfo here

SetTimer(2, true);

}

function Timer()
{

local ROGameInfo MyGameInfo;
local ROMapInfo MyMapInfo;
local Controller MyController;
local ROPlayerReplicationInfo MyPlayerInfo;

MyMapInfo = ROMapInfo(WorldInfo.GetMapInfo());
MyGameInfo = ROGameInfo(WorldInfo.Game);

for (MyController = WorldInfo.Controllerlist; MyController != None; MyController = MyController.NextController)
{
MyPlayerInfo = ROPlayerReplicationInfo(MyController.PlayerReplica tionInfo);

//do something with MyPlayerInfo, MyGameInfo and MyMapInfo here

}

}


Does it matter if MyMutator extends Mutator or ROMutator?
Do I need to do some destroying, now when Timer() is executed every 2 seconds?
If PreBeginPlay() needs to be executed both client and server side, is it ok to have it as simulated function here, now when Timer() is executed only server side? If I have understood docs correctly, this is what happens with this mutator.


Couple of mutator coding questions

Aucun commentaire:

Enregistrer un commentaire