How do I replace all Text objects with SpriteFonts

0 favourites
  • 5 posts
From the Asset Store
OpenAI TTS
$10 USD
Text-to-Speech plugin.Allows your Construct 3 project to convert written text into spoken words
  • Hey,

    Is there any easy way to replace all Text Objects with SpriteFont objects? And maintain all my events?

    I'm assuming not, but wanted to check with all the smart cookies of this forum before I painstakingly go through and replace over 1000 events (not even exagerated sadly).

    thanks in advance!

  • So I found a way, it's a bit of a pain in the ass and kind of risky. So if you need to do the same thing, BACKUP FIRST!

    !!PROCEED WITH CAUTION!!

    Basically, you need to edit the XML's for the layout and the event sheet.

    First, in your project create the new objects (in my case SpriteFont's) and name them something obvious. I used the same name with "2" on the end.

    Save your project, must be as a project and not a single file.

    Close Construct2.

    Open the layout XML in your preferred editor and replace the names, lets say Title with Title2.

    If you are going to a new object type with different parameters (like Text to SpriteFont) you will need to also put the new parameters into the XML. I suggest making a fully setup copy of your new Object in the editor first and copy pasting.

    Then, do the same in the Event Sheet XML, just replace all the names.

    This will work to replace any Object Type with another one, provided they have IDENTICAL sets of ACE's

    This worked for me and saved hours of replacing events in the engine and retyping everything... Still not an easy task. Better suggestion, design it right first time round!

  • KeeghanM thanks for the tip!

    Do you know what the "sid" tag is for in the event sheets XMLs?

    <action id="0" name="Set text" sid="140336039528208" type="GameOverText">[/code:34f6o06t]
    
    I was also thinking about making some bulk changes by editing XML files, but I was worried about this sid tag.. What if it's somehow related to the object which I'm replacing?
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • dop2000 I think (stress on the think) that its an id associated with the action, not the object.

    I haven't had any issues when I only replace the type value.

  • KeeghanM

    That's what I was thinking too, but still a bit worried

    I just made a little test - replaced Text object with SpriteFont object in an event (manually in C2), and then compared xml files - sid tag remained the same.

    So yeah, it should be safe to change objects in xml.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)