Jump to content

Photo

tango.zh


  • Please log in to reply
398 replies to this topic

#91 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 01 September 2014 - 01:15 PM

I realize you added string control codes to the tango folder. Are those fully implemented yet, and if so how do we use them?


Edited by Freya, 01 September 2014 - 01:15 PM.


#92 Saffith

Saffith

    IPv7 user

  • Members

Posted 01 September 2014 - 03:15 PM

Yeah, they're all done. They're disabled by default, since one might not want to use them. To enable them, import stringControlCode.zh instead of stringControlCodeDisabled.zh. They're only expected in ZC messages; they aren't parsed in ZScript strings. You can encode them yourself, of course, but that's kind of a pain.

#93 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 02 September 2014 - 12:08 PM

Awesome!



#94 Saffith

Saffith

    IPv7 user

  • Members

Posted 11 January 2015 - 09:42 PM

Hey, it's finally done! Sorry it took so long. Again.

Saves using the last beta will be invalidated, but there shouldn't be any compatibility issues. The array sizes have changed again.

It's mostly bug fixes and cleanup, but there's one big new feature. You can now create custom variables. Tango_D[] is included by default, but it can be removed.
There are a few other little things, too. When a string is so long that it has to scroll down, you can now control the scrolling. There's a function to get the current slot when running a custom function. The demo scripts have been cleaned up quite a bit, too.
  • David likes this

#95 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 12 January 2015 - 02:09 AM

https://www.youtube.com/watch?v=_J6-3l3hCm0

 

Congratulations on completing this finally. Took a while and your dedication has proven itself. So did you ever figure out what was going on with the stringcontrol codes and why Error was crashing my game in Ruto. No Pun intended that's his name actually.


  • Demonlink likes this

#96 Saffith

Saffith

    IPv7 user

  • Members

Posted 12 January 2015 - 10:26 AM

They didn't have any special handling during loading; it just treated them like text. That's usually not a problem, but if there happened to be a @ in there, it would get confused.

#97 C-Dawg

C-Dawg

    Magus

  • Members

Posted 12 January 2015 - 12:03 PM

Fantastic work, Saffith.  Hopefully you will get some quest designers sufficiently dedicated to putting this system into place; it's a vast improvement on the default way ZClassic handles strings.  

 

For your next trick, will you be designing a Z-3 style scrolling system that is compatible with Zelda Classic's map making and enemy setting utilities?  



#98 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 12 January 2015 - 10:16 PM

This is the first time I'm actually willing to try this out. However, I'm confused by various points. Is there a limited quantity of slots? I've been trying to find answers within the file itself, which lead my conclusion to these:

 

// Text buffer and slots
int __Tango_Buffer[1024]; // Arbitrary size

By arbitrary means any size I please to make the buffer, right? And the next things I'm confused about are:

 

int __Tango_SlotDefs[] = {
    // 0
    TANGO_SLOT_NORMAL,
    0,        // Starting index in __Tango_StringBuffer
    512,      // Maximum length after processing
    0, 0,     // X, Y on offscreen bitmap
    256, 512, // Width, height on offscreen bitmap

What's the starting index in the buffer? And what is the maximum length after processing? And one last question, what "is" a bitmap?


Edited by Demonlink, 12 January 2015 - 10:17 PM.


#99 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 12 January 2015 - 10:23 PM

Yes, Tango is confusing to get into.

 

  • You can make as many Tango slots as you like, but each one makes your save file bigger and increases ZC's memory requirement.
  • The Tango buffer needs to be big enough to hold the biggest possible string that can be in every slot all at once. So, sum up the max size of each slot you make.
  • Slot attributes: 1) Starting index is where in the Tango buffer array this slot's strings start. 2) Max size after processing is the max possible length of a string (after appends, etc) that can be in this slot.
  • Bitmaps in ZC are "image storage areas" that you can draw to with draw primitives (DrawTile, etc) and then draw to the screen. Tango draws each letter of a string onto these bitmaps then draws the entire bitmaps onto the screen. For use in Tango, just make sure that the bitmap X/Y and Width/Height are set up so that no slots have their bitmap segments overlap.

  • Demonlink likes this

#100 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 12 January 2015 - 10:43 PM

Thanks for helping me out MM! :D But I'm still troubled by a few more things:

 

  • The Tango buffer needs to be big enough to hold the biggest possible string that can be in every slot all at once. So, sum up the max size of each slot you make.

    Max size after processing is the max possible length of string (after appends, etc) that can be in this slot.

So, in this case, the max size is determined by how many characters the longest string in all slots has? Another thing, let's say I make a string in ZC or in ZScript. Do I have to make a slot for each string I make, or do the slots function similar to a template for display? An example for what I mean. Let's say I assign 16 to x and 55 to y on Slot 0, I make two strings that I want to display at the same coordinates and same height and width. So, do I make a slot for each, or can I use one slot for both?

 

And I'm still confused on the starting index of the slot array because of the demo's example:

 

    // 0
    TANGO_SLOT_NAVI,
    0,       // Starting index in __Tango_StringBuffer
    64,      // Maximum length after processing
    256, 0,  // X, Y on offscreen bitmap
    128, 64, // Width, height on offscreen bitmap
    
    // 1
    TANGO_SLOT_POPUP,
    64,
    128,
    256, 64,
    128, 64,

What logic does it follow for it to jump from 0 and then to 64 on Slot 1?  :confused:


Edited by Demonlink, 12 January 2015 - 10:47 PM.


#101 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 12 January 2015 - 10:55 PM

Each slot can be loaded with one string at a time. More slots means more strings on-screen at a time. If you are only using Tango as a replacement for ZC's messages, you'll only need one. For example, Solaris has three: Normal strings, area name pop-ups, and minor item pop-ups.

 

The first slot in that example starts at 0 and is 64 long. The next slot starts at 64 and is 128 long. If you added a third, it would have to start at 64+128=192.

 

The actual location of a string on the screen is defined in the style, not the slot. Slots are only containers for the text of the string.


  • Demonlink likes this

#102 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 12 January 2015 - 11:04 PM

Each slot can be loaded with one string at a time. More slots means more strings on-screen at a time. If you are only using Tango as a replacement for ZC's messages, you'll only need one. For example, Solaris has three: Normal strings, area name pop-ups, and minor item pop-ups.

I see now. So, let me see if I understand how slots are used. In your case in Solaris, you require 3 slots in case you have an NPC, item and area pop up all in one same screen? Thus, you need 3 strings to appear all at the same time?

 

The first slot in that example starts at 0 and is 64 long. The next slot starts at 64 and is 128 long. If you added a third, it would have to start at 64+128=192.

Ohhhh! That makes so much sense now! (I was confused at first because I thought it was supposed to follow a binary pattern  :doh:) One last question now that I'm figuring this out. How is the max size actually defined? By counting each character in the longest string in it? Or is it a value that's returned after some sort of compilation?

 

Thanks again, I'm getting the hang of this now! :) (I think)



#103 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 12 January 2015 - 11:07 PM

To get the max value, just consider the longest string you'll ever have in the game (including strings that get @appended, but not ones that use @next), and set the size of the slot to more than that. You could probably leave the sample value of 128 if you don't have ridiculously-long strings.


  • Demonlink likes this

#104 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 12 January 2015 - 11:11 PM

Thank you Moscow for your patience! I think I'm getting the hang of it now! :)



#105 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 15 April 2015 - 06:51 PM

So I am having issues with using TangoQuickStart. I imported the files needed for this and put the required functions into the Global Script and this is what I get:

 

Q5GRfhX.png

 

 

The script that is displaying the message:

ffc script HelloWorld{
    void run(int str){
        ShowString(str);
    }
}

Edited by Orithan, 15 April 2015 - 06:52 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users