Page 2 of 2

Re: I has a question about 227...

Posted: Sun Jan 04, 2009 12:09 pm
by GreatEmerald
Also about returns, the Wiki says that it could also be like this:

Code: Select all

function bool CheckReplacement(Actor Other,out byte bSuperRelevant)
{
if(Other.class==Class'something.something')
{
ReplaceWith(Other,"something");
return false;
}
else if(...)
{
...
return false;
}
else if(...)
{
...
return false;
}
...
else return false;

return true;
} 
don't remember and the site is down, but the last two might be inverse - else return true return false. Note the use of else - your script will be a lot faster because it won't have to recheck everything all over again. Logically, an actor will never have two class names!

Another thing to note: you should use one mutator instead of three to make sure that they don't conflict with each other. However, sometimes three are better, like if you will release them separately, but you should still be aware that one is better than three. And the last thing, I'm not sure if there are mutator groups in UE1, but if there are, make sure the group name is "Arena" - this will prevent other mutators of the same group to be added in a game, thus preventing conflicts.

Re: I has a question about 227...

Posted: Sun Jan 04, 2009 2:02 pm
by KillerSkaarj
I'm using UE2, 227 version. I'll make sure to do that. I wanted three mutators because the Stinger Minigun is a hybrid of two guns that already exist in Unreal 1. I wanted it so that you could have it replace one, the other, or both.

Re: I has a question about 227...

Posted: Sun Jan 04, 2009 4:53 pm
by Bane
I'll try making everything with correct cases.
Unreal and UScript are case insensitive, so don't worry about doing something like that.
NOOOO, please don't skip that. Unreal in windows may be case insensitive but Unreal in Linux is (for filenames only). So if you or anyone else ever wants to compile stuff with UCC in Linux- the filenames need to be :)
I thought he was talking about something like class'STINGER'. Unreal and UScript ARE case insensitive (although if you plan to do any future programming work it'll become a bad habit if you take advantage of it too much), while Linux is not but windows is. But I mean honestly, how often do you use UScript to interact with the filesystem anyways?!
Also about returns, the Wiki says that it could also be like this:

Code: Select all

function bool CheckReplacement(Actor Other,out byte bSuperRelevant)
{
if(Other.class==Class'something.something')
{
ReplaceWith(Other,"something");
return false;
}
else if(...)
{
...
return false;
}
else if(...)
{
...
return false;
}
...
else return false;

return true;
} 
Note the use of else - your script will be a lot faster because it won't have to recheck everything all over again. Logically, an actor will never have two class names!
Nope. Shouldn't be any faster. 'Return' stop execution of the script, so if you hit the first case with just if, it stops, and if you hit the first case with if else, it stops. If there wasn't a return it would be faster, but in this case it shouldn't make any difference.




I'm starting to get the feeling this topic is on the wrong board.