• Mods are now organized as resources. Use the Mods link above to browse for or submit a mod, tool, or prefab.

    The TFP Official Modding Forum Policy establishes the rules and guidelines for mod creators and mod users.

GetActivationText

Boogman

Refugee
Is this how you change the text the player sees when he looks at a block.

I tried it but got an error: Format Exception: Input string not in a correct format.

Code:
using System;
using UnityEngine;

public class BlockmyElevator : Block
{

   public override string GetActivationText(WorldBase _world, BlockValue _blockValue, int _clrIdx, Vector3i _blockPos,
       EntityAlive _entityFocusing)
   {
       return "Press <{E}> to operate the Elevator";
   }

}
 
Is this how you change the text the player sees when he looks at a block.
I tried it but got an error: Format Exception: Input string not in a correct format.

Code:
using System;
using UnityEngine;

public class BlockmyElevator : Block
{

   public override string GetActivationText(WorldBase _world, BlockValue _blockValue, int _clrIdx, Vector3i _blockPos,
       EntityAlive _entityFocusing)
   {
       return "Press <{E}> to operate the Elevator";
   }

}
It's the { } that it's upset about. You can use that if you are using the localization and the string.Format() command.

But since you are just returning a string, you don't need to use them.

Code:
return "Press <E> to operate the Elevator";
 
Wow, I didn't think it would matter, they were inside the quotes.

It's working now...!

Thank you...!

 
Last edited by a moderator:
Back
Top