Jump to content

Photo

Interactive strings


  • Please log in to reply
19 replies to this topic

#1 Evile

Evile

    Dolphinslayer

  • Members

Posted 14 April 2010 - 02:21 AM

I was wondering if it would be at all possible to make strings that you can actually interact with and not just read though. This feature is in almost every single zelda game, why not zelda classic too?

Here's some screenshots so you know exactly what I'm talking about:
TMC:
IPB Image

OoA:
IPB Image

LttP:
Image probably too big...

I would prefer it to be like in LttP so more than one word answers would be easier.

Thanks for any help, this would probably benefit the community as a whole as well. icon_wink.gif

Edited by Evile, 14 April 2010 - 02:22 AM.


#2 Joe123

Joe123

    Retired

  • Members

Posted 14 April 2010 - 06:14 AM

I'm currently in the (nearing the end of the) process of writing a set of custom ZScript string functions.
It has a 'yes/no' selector which is in its own box, I didn't think of making it inside the message frame.

What you've just posted's given me an idea though; with the selections inside the textbox (which can be as many rows in height as you want), I could have the 'choice' control code select between an arbitrary number of user-defined choices, rather than just Yes/No.

The only problem is it'll be a hell of a lot more complicated...

#3 Daemon

Daemon

    Apprentice

  • Members
  • Real Name:Sabbastian
  • Location:United States

Posted 14 April 2010 - 09:14 AM

Well, a simple script for it would be rather easy to make. It will just take time to give it a lot of features (how many options, where the text appears, etc.)

I guess it's only natural that you'd be working on it, Joe. icon_razz.gif

Evile, if you just wanted a simple two (or more) choice answer system, I could probably write something up for you. Though, it sounds like Joe's writing a good script for it already. So you may just want to wait for his.

Edited by Daemon, 14 April 2010 - 09:15 AM.


#4 Joe123

Joe123

    Retired

  • Members

Posted 14 April 2010 - 09:34 AM

I thought it was one of the most complicated things I've written (/seen written) in ZScript, I had to write a parser and stuff.

The only issue is that it'll appear a little bit more complicated for a non-scripter to use, you enter the strings into a .zh file and stuff. It's actually quite simple (and you don't have to use the horrible built in string editor) really though, you just have to copy an if block and add a constant for each new string.

#5 Daemon

Daemon

    Apprentice

  • Members
  • Real Name:Sabbastian
  • Location:United States

Posted 14 April 2010 - 11:20 AM

Well, I guess it depends how complex you're making it. I thought you could just use a variable to track which option's being selected, and then use button checks to input answers.

Although, from what it sounds like, you're making more than a simple selection. It seems your making an alternate way to display strings? Or maybe I misread your post?

Edited by Daemon, 14 April 2010 - 11:25 AM.


#6 Joe123

Joe123

    Retired

  • Members

Posted 14 April 2010 - 12:31 PM

Yeah, it parses the control codes out of the string and then displays the string according to them.

If you just wanted to do, say, 'DrawString(string);' for the choices and move the cursor it'd be pretty simple, but that's not quite what I'm going for ;-)

I've already written the whole thing really and it's currently being bugtested, but I've got a bit more to do with it still - a couple more control codes for moving the string pane and now I intend to add this functionality.
I'm also writing a few C-like string functions (sprintf, strcat etc.) for another header file to be distributed with ZC, then I'll release the code when it's all done.

#7 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 April 2010 - 03:09 PM

hmm... What if Santa put in a new function like: "Game->GetMessage( int message_number, int format, int & out_stringRef );". This would be pretty straight forward in that it couldn't possibly cause any issues.

I will leave out some milk and cookies for him. ...icon_heh.gif

#8 Joe123

Joe123

    Retired

  • Members

Posted 14 April 2010 - 03:22 PM

Judging from his previous commit Santa probably needs to be a bit more careful with the way he acquires the ramref index.
What about the cases where ri.ramref has been changed since the memory was allocated? I didn't change the way the pointers are stored for kicks...

Your function's assuming that people would want to use the in-built editor though; I can't personally think of any reasons at all why you'd want to use that over notepad for typing in strings...

#9 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 April 2010 - 03:33 PM

Honestly, I don't really use the built in editor at all. I guess I'm not the only one. Apperantly getting string from it wouldn't be that useful then?


No, it's cool. I set the *ramref.easy_button = 1; first.

#10 Joe123

Joe123

    Retired

  • Members

Posted 14 April 2010 - 03:36 PM

Well, I'm sure it wouldn't hurt. Part of the reason behind my writing my drawstring functions was because I'd rather write my strings in notepad though.

Why didn't I think of that ¬_¬

#11 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 April 2010 - 03:43 PM

QUOTE(Joe123 @ Apr 14 2010, 01:36 PM) View Post

Why didn't I think of that ¬_¬


Yeah I know. Actually if you wanted to encapsulate those functions into a scriptram helper class (or a namespace if you don't like classes) next time you add one I would be very thankful. icon_smile.gif

#12 Joe123

Joe123

    Retired

  • Members

Posted 14 April 2010 - 03:52 PM

I'm about very not awake at the moment and I can't work out how much of a joke that is

#13 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 April 2010 - 04:02 PM

lol. No joke. I'm serious. icon_wink.gif

#14 Joe123

Joe123

    Retired

  • Members

Posted 14 April 2010 - 04:04 PM

Oh, right.
What would you want it to do exactly that it doesn't already?
All it is is that the pointer is stored in the first two bytes of the variable, and the ramref is bitshifted up above that.

#15 Christian

Christian

    Summoner

  • Members
  • Real Name:Chris
  • Location:New Jersey

Posted 26 August 2010 - 11:41 PM

How would you make a cursor appear on a string if i use the String.zh codes? I'm thinking on ditching the built-in string editor.

Edited by Christian, 26 August 2010 - 11:43 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users