Page 1 of 1

Q. about ActivateTranslator and ActivateHint exec functions

PostPosted: Mon Oct 24, 2016 3:58 am
by PrinceOfFunky
Hello, I was wondering why those two exec functions don't work when called on UT.
I see these are the two functions into PlayerPawn.uc
Code: Select all
// Translator Hotkey
exec function ActivateTranslator()
{
   if ( bShowMenu || Level.Pauser!="" )
      return;
   If (Inventory!=None) Inventory.ActivateTranslator(False);
}

// Translator Hotkey
exec function ActivateHint()
{
   if ( bShowMenu || Level.Pauser!="" )
      return;
   If (Inventory!=None) Inventory.ActivateTranslator(True);
}


This other is from Inventory.uc
Code: Select all
function ActivateTranslator(bool bHint)
{
   if( Inventory!=None )
      Inventory.ActivateTranslator( bHint );
}


The calls are not working even when I have a Translator pickup in my Inventory.
This is the code from Translator.uc
Spoiler: show
Code: Select all
function ActivateTranslator(bool bHint)
{
   if (bHint && Hint=="")
   {
      bHint=False;
      Return;
   }
   bShowHint = bHint;
   Activate();
}


Does someone have an idea of why the player can't call those two functions?

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Mon Oct 24, 2016 5:48 am
by Wormbo
This is a slightly convoluted one. First, in UT all players auto-activate their inventory and DMMutator forcibly makes all Pickups bAutoActivatable. Second, auto-activatable pickups automatically activate themselves when they are added to a player with auto-activation. Third, active auto-activatable pickups refuse to be activated again. And fourth, you already quoted the Translator code that clearly say Activate();, which has no effect due to the aforementioned things.

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Mon Oct 24, 2016 3:45 pm
by PrinceOfFunky
Wormbo wrote:This is a slightly convoluted one. First, in UT all players auto-activate their inventory and DMMutator forcibly makes all Pickups bAutoActivatable. Second, auto-activatable pickups automatically activate themselves when they are added to a player with auto-activation. Third, active auto-activatable pickups refuse to be activated again. And fourth, you already quoted the Translator code that clearly say Activate();, which has no effect due to the aforementioned things.

I put the Translator code to show you that there's no need of any other check to call that function in the Inventory.
I know the activation is automatic but they both are exec functions, they might be working even if the Inventory is already activated.

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Mon Oct 24, 2016 8:37 pm
by Wormbo
/me sighs

Okay, let's see that again fro ma different angle. How do you think the Translator displays its messages? The Translator class has no message rendering features whatsoever. Apparently only the UnrealHUD really cares about Translators. UT game modes use ChallengeHUD derivatives, which is a sibling of UnrealHUD and thus there's nothing that cares about Translators there.

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Mon Oct 24, 2016 9:08 pm
by EvilGrins
There's clearly some doubt as to whether the translator actually does anything in UT, but I simplified the issue of using it a long time ago.

I simply keybound the thing to the Enter-key. It works well enough like that...

...although mostly these days I only ever see a translator when a UTDMT drops one. It's their default drop-item.

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Mon Oct 24, 2016 11:14 pm
by sektor2111
I don't know if you did read previous "translator" posts (not g00gle translator). It's a need for rewriting this INVENTORY because default has no deal - I did some thing for Aldebaran which somehow do works - honestly I did not tested it in Books written in some Levels good to waste time (for whoever has life a permanent holiday). Games usually using it are sort of SP COOP MH non stock games... else you can customize a trigger added over translator event and rendering a small TXT in a sort of PostRender attached stuff if you are familiarized with HUD codes. Another way might be (guessing here) modifying HUD itself used in UT games. In games which aren't activating this, a key can be bound and others for switching items (scuba, flashlight, translator, etc.) which can be manually selected activated.

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Mon Oct 24, 2016 11:28 pm
by PrinceOfFunky
Actually, I don't care about the Translator actor itself, I only care about the exec functions, which MIGHT be called if you write their name in console. That's what I'm not getting, all exec functions are called if you write their names in console, why not these two ones?

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Tue Oct 25, 2016 5:46 am
by Wormbo
PrinceOfFunky wrote:Actually, I don't care about the Translator actor itself, I only care about the exec functions, which MIGHT be called if you write their name in console. That's what I'm not getting, all exec functions are called if you write their names in console, why not these two ones?

All of them? I doubt that. Which ones did you test?

Re: Q. about ActivateTranslator and ActivateHint exec functi

PostPosted: Tue Oct 25, 2016 6:14 am
by PrinceOfFunky
Wormbo wrote:
PrinceOfFunky wrote:Actually, I don't care about the Translator actor itself, I only care about the exec functions, which MIGHT be called if you write their name in console. That's what I'm not getting, all exec functions are called if you write their names in console, why not these two ones?

All of them? I doubt that. Which ones did you test?

Actually, not all of them :/
I thought all of them would have worked, UnrealWiki doesn't specify there may be exec functions which won't execute:
someone on the UnrealWiki wrote:Exec Functions are functions that a player or user can execute by typing its name in the console. Basically, they provide a way to define new console commands in UnrealScript code.

Oh well, thanks for the info then :D