user265889
user265889

Reputation: 667

Unreal Script code modding strange issue

I've been modding this game called "Outlast" which is based on unreal engine 3.5 for some time now and I'm having a problem that is more C++ related as unreal script is based on C++:

I'm calling an existing function in game that requires a string and a boolean, this is that function:

event StartNewGameAtCheckpoint(string CheckpointStr, bool bSaveToDisk){
local OLCheckpoint CheckCP, startCP;
local OLHero Hero;
local OLGame CurrentGame;
local OLEngine Engine;


// End:0x33
if(CheckpointStr == "KillHero") >>> this if is new code that I added myself
{
     NumBatteries = 86;
     NotifyDifficultyChanged();
     return;
} ... more irrelevant code comes after this > }

I'm calling that function here (2 ways possible):

Method A:
class'OLGFxMoviePlayer'.static.GetOLPC().StartNewGameAtCheckpoint("KillHero", false);
Method B:
Outer.GetOLPC().StartNewGameAtCheckpoint("KillHero", false);

There is one weird problem I'm having at this point, the "KillHero" string isn't making it to that function for some reason (both methods) so the if statement will fail because "CheckpointStr" is not "KillHero"at all!

For anyone wondering where GetOLPC is coming from, it is to get the current playercontroller and that function goes like this:

function OLPlayerController GetOLPC(){
return OLPlayerController(GetPC());
//return ReturnValue;   
} 

And through this function you can gain access to the class "OLPlayerController" which holds "StartNewGameAtCheckpoint"

I know it's the if because if I place numbatteries and notifydifficultychanged outside of the if it works fine.

It should technically work as somewhere else the game is doing this:

Outer.consolecommand("camera freecam");

which also uses a string inside but this works fine.

Does anyone know what's wrong?

Thanks

Upvotes: 0

Views: 104

Answers (1)

user265889
user265889

Reputation: 667

Well... I feel really dumb right now haha! Since I was hex modding the game I needed to use 7A which is "EqualEqual_StringString" but I used FE which is "EqualEqual_NameName" it's very deceiving as both represent "==" xD

Upvotes: 0

Related Questions