Q. about ActivateTranslator and ActivateHint exec functions

Discussions about Coding and Scripting
Post Reply
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Q. about ActivateTranslator and ActivateHint exec functions

Post 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

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?
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
Wormbo
Adept
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm
Contact:

Re: Q. about ActivateTranslator and ActivateHint exec functi

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

Re: Q. about ActivateTranslator and ActivateHint exec functi

Post 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.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
Wormbo
Adept
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm
Contact:

Re: Q. about ActivateTranslator and ActivateHint exec functi

Post 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.
User avatar
EvilGrins
Godlike
Posts: 9668
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Q. about ActivateTranslator and ActivateHint exec functi

Post 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.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Q. about ActivateTranslator and ActivateHint exec functi

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

Re: Q. about ActivateTranslator and ActivateHint exec functi

Post 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?
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
Wormbo
Adept
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm
Contact:

Re: Q. about ActivateTranslator and ActivateHint exec functi

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

Re: Q. about ActivateTranslator and ActivateHint exec functi

Post 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
"Your stuff is known to be buggy and unfinished/not properly tested"
Post Reply