Q. about ActivateTranslator and ActivateHint exec functions

Discussions about Coding and Scripting

Q. about ActivateTranslator and ActivateHint exec functions

Postby PrinceOfFunky » Mon Oct 24, 2016 3:58 am

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?
Image
User avatar
PrinceOfFunky
Godlike
 
Posts: 1023
Joined: Mon Aug 31, 2015 10:31 pm

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby Wormbo » Mon Oct 24, 2016 5:48 am

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.
User avatar
Wormbo
Adept
 
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby PrinceOfFunky » Mon Oct 24, 2016 3:45 pm

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.
Image
User avatar
PrinceOfFunky
Godlike
 
Posts: 1023
Joined: Mon Aug 31, 2015 10:31 pm

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby Wormbo » Mon Oct 24, 2016 8:37 pm

/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.
User avatar
Wormbo
Adept
 
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby EvilGrins » Mon Oct 24, 2016 9:08 pm

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.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
User avatar
EvilGrins
Godlike
 
Posts: 6183
Joined: Thu Jun 30, 2011 8:12 pm
Location: Palo Alto, CA
Personal rank: God of Fudge

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby sektor2111 » Mon Oct 24, 2016 11:14 pm

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.
User avatar
sektor2111
Godlike
 
Posts: 3959
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby PrinceOfFunky » Mon Oct 24, 2016 11:28 pm

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?
Image
User avatar
PrinceOfFunky
Godlike
 
Posts: 1023
Joined: Mon Aug 31, 2015 10:31 pm

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby Wormbo » Tue Oct 25, 2016 5:46 am

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?
User avatar
Wormbo
Adept
 
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm

Re: Q. about ActivateTranslator and ActivateHint exec functi

Postby PrinceOfFunky » Tue Oct 25, 2016 6:14 am

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
Image
User avatar
PrinceOfFunky
Godlike
 
Posts: 1023
Joined: Mon Aug 31, 2015 10:31 pm


Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 2 guests