Jump to content

Brightsea Empire

Photo

Shopping!


  • Please log in to reply
5 replies to this topic

#1 jsm116

jsm116

    Script kludger

  • Members
  • Location:The 301

Posted 11 April 2015 - 08:23 PM

This morning I turned to my wife and said "Because I'm a glutton for punishment, I'm going to script the shops." Took 10 hours and still needs some tweaking, but the basic functionality is there. If Link is on the correct tile and presses A, the shop window opens with a list of buyable items, similar to the shops in the SNES Final Fantasy games. Now, if you try to purchase an ammo item that you're full on or an equipment item you already own, it won't let you. Most importantly, there's room for up to 12 items per shop, and there can be as many shops on the screen as I like.
  • MoscowModder, Jared, Demonlink and 3 others like this

#2 SyrianBallaS

SyrianBallaS

    Defender

  • Members
  • Real Name:Samer
  • Location:Detroit, Michigan

Posted 11 April 2015 - 08:57 PM

Did this utilize the tango? ZC sure has evolved when I first used it.



#3 jsm116

jsm116

    Script kludger

  • Members
  • Location:The 301

Posted 11 April 2015 - 09:10 PM

I didn't use tango for this or my subscreen. The string functions built in to zscript are enough for what I need. The part I was having difficulty with was getting the shop to load when you press A at the right spot, and then close when you want it to, without activating the item equipped in A. This was way, way more difficult than it should have been. Short version, there's a check in the global that checks anytime you press A if you're standing on a combo with a certain inherent flag. If so, it finds the ffc that's also on that combo to get the shop type and then launches the shop window. Initially I had had the shop launched by the ffc itself, modifying a signpost script to launch the shop instead of displaying a message, but the function Screen->Message automatically discards the A input. With launching the shop instead, the A input still goes through (although delayed until after you close the window) and your equipped item fires. I tried putting in lines to kill the input in about a dozen different places, none of which worked.

 

So I took a nap, and when I got up I realized I should move the call function to the global, where the input can be more easily controlled. Then it was just a matter of the two checks (one for the inherent flag, the other for the ffc) and everything works fine :)


  • ShadowTiger, Avaro and SyrianBallaS like this

#4 Zolias

Zolias

    Retired Darknut Captain; Apprentice Wizrobe

  • Members
  • Location:Lurking the forums for new ZC games!

Posted 12 April 2015 - 12:13 AM

I didn't use tango for this or my subscreen. The string functions built in to zscript are enough for what I need. The part I was having difficulty with was getting the shop to load when you press A at the right spot, and then close when you want it to, without activating the item equipped in A. This was way, way more difficult than it should have been. Short version, there's a check in the global that checks anytime you press A if you're standing on a combo with a certain inherent flag. If so, it finds the ffc that's also on that combo to get the shop type and then launches the shop window. Initially I had had the shop launched by the ffc itself, modifying a signpost script to launch the shop instead of displaying a message, but the function Screen->Message automatically discards the A input. With launching the shop instead, the A input still goes through (although delayed until after you close the window) and your equipped item fires. I tried putting in lines to kill the input in about a dozen different places, none of which worked.

 

So I took a nap, and when I got up I realized I should move the call function to the global, where the input can be more easily controlled. Then it was just a matter of the two checks (one for the inherent flag, the other for the ffc) and everything works fine :)

I have no idea what you just said here, but if it makes a shop function similarly to a FF shop, with a window to purchase stuff, this MAY revolutionize a great many shops in future quests if you release the script as a seperate download (of course, after bugtests to make sure it functions properly)!



#5 jsm116

jsm116

    Script kludger

  • Members
  • Location:The 301

Posted 12 April 2015 - 11:32 AM

Maybe? I was figuring to release the whole of my code at some point after the game's released (maybe a few months after). We shall see.



#6 jsm116

jsm116

    Script kludger

  • Members
  • Location:The 301

Posted 12 April 2015 - 03:23 PM

Addenda: the way I ended up getting the FFC to work there's only one shop per screen, but this isn't really the end of the world. Also, I max the items at 8, but this could easily be changed to 10 if necessary. Also, I currently don't have the descriptions up, but would they really be necessary? I feel like pretty much everything you'd buy in a shop is self-explanatory, but it also wouldn't be difficult to add descriptions, just tedious.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users