Question #1:
I'm wondering how to iterate through each element in an array. Consider the following example:
ROMI = ROMapInfo(WorldInfo.GetMapInfo());
function FindAxisRole()
{
local int i;
local int RoleArrayLength;
foreach(ROMI.AxisSquads[0].FireTeams[0].Roles, i)
{
if(Roles.RoleInfo == class'RORoleInfoAxisRifleman')
{
WorldInfo.Game.Broadcast(self, "Found a Axis Rifleman!");
}
}
WorldInfo.Game.Broadcast(self, "Looped through all roles");
}
When I compile this it complains about the foreach line, saying
"Error, Missing ")" in expression."
I'm clearly using the foreach incorrectly. Could someone enlighten me as to what I'm doing wrong?
Question #2:
It seems the compiler does not recognise any Rising Storm classes. So far I've tried RSRoleInfo and RSMapInfo, and the compiler doesn't recognise either.
local RSMapInfo MyRSMI;
gives me the following error: "Error, unrecognized type 'RSMapInfo'." I also noticed while playing around with the editor that RS packages are not loaded by default like RO2 packages are. It feels like this is related.
Any ideas?
I'm wondering how to iterate through each element in an array. Consider the following example:
ROMI = ROMapInfo(WorldInfo.GetMapInfo());
function FindAxisRole()
{
local int i;
local int RoleArrayLength;
foreach(ROMI.AxisSquads[0].FireTeams[0].Roles, i)
{
if(Roles.RoleInfo == class'RORoleInfoAxisRifleman')
{
WorldInfo.Game.Broadcast(self, "Found a Axis Rifleman!");
}
}
WorldInfo.Game.Broadcast(self, "Looped through all roles");
}
When I compile this it complains about the foreach line, saying
"Error, Missing ")" in expression."
I'm clearly using the foreach incorrectly. Could someone enlighten me as to what I'm doing wrong?
Question #2:
It seems the compiler does not recognise any Rising Storm classes. So far I've tried RSRoleInfo and RSMapInfo, and the compiler doesn't recognise either.
local RSMapInfo MyRSMI;
gives me the following error: "Error, unrecognized type 'RSMapInfo'." I also noticed while playing around with the editor that RS packages are not loaded by default like RO2 packages are. It feels like this is related.
Any ideas?
Last edited: