[ Login | Register ]

The Shining Source

« previous next »
Pages: [1] 2 Print
My Java Experience   (Read 30525 times)
Old Post September 06, 2005, 04:52:36 pm
#1
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
So I don't know if you guys know my current Java Project, but it's to make a shop system with shining force feel - and considering I only just learnt how to draw stuff to the screen with it earlier this evening I'm happy with my progress for the day.

I really should be working in with the existing BABS and SSCS classes etc, but I figure I'll make my own independent system in order to learn how the heck it works - and by then I might be able to understand enough of the language to tie it in with existing party member inventory structure and such that is necessary.

~Elvenfyre


Old Post September 06, 2005, 04:57:51 pm
#2
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
Why do I bother to post this, I just realised.  Well I find it a lot easier to tell people about my baby steps and then I feel less frustrated even if I don't get anywhere Smiley



this is the starting point where i start with loops and drawing stuff to the screen.  
A list of what I see as the steps will probably help me too.
Importing pictures into the program to display as the weapons.
Gathering weapon name, price and picture information from an external text file to fill the shop class.
user input to move selection box between items.
user input to select buy or cancel.

otherstuff...
money calculations, item placement into inventory, chit-chat responses by the shopkeeper and "are you sure" yes no decisions.  Selling items back.

~Elvenfyre


Old Post September 06, 2005, 06:05:24 pm
#3
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
OK so I've managed to work out key listening, and made a red selector border thing that moves between the items.



http://www.jaesign.com/desmond/java/shop.html

You have to click on the window, arrow keys to move it.
I'm proud Tongue

~Elvenfyre


Old Post September 06, 2005, 08:54:42 pm
#4
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
I think I've got classes sorted... umm, well ok here's the thing.
I've spent quite a while trying to get it to pull the amount of weapons and then the weapon details from an external file and have so far been unsuccessful - but using my items class and creating instances of weapons inside the shop class is working fine so it's only a matter of time.
Must go to sleep now though.



http://www.jaesign.com/desmond/java/shop.html

~Elvenfyre


Old Post September 06, 2005, 09:27:24 pm
#5
Administrator
Shining Spammer *

Posts: 1,208

Logged
My Java Experience
Hi Elv,

Check the java Properties object. It's great for loading plain text stuff from external files Smiley.

Devlyn

Great news for Shining fangame developers! Wink

Correcting your non-working <img> tags since 1982 Wink


Old Post September 06, 2005, 10:11:40 pm
#6
Ty
Administrator
Shining Sideburns *

Posts: 837

Logged
My Java Experience
Nice work there Elv, especially if you're just starting with Java and OO programming. I always liked coding shops, don't know why.

Looking forward to your first Shining game Wink


Old Post September 07, 2005, 10:25:39 am
#7
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
Haha thanks guys Smiley  I think I'll stick with the shop system for now haha.

Well Devlyn I have a problem with the Properties object- I'm using FileInputStream the same way you use it for your entityfile and itemfile, and it's compiling, but on loading in the browser it isn't running(properly) - open java console and it says it doesn't have access to open the shopfile  : /
I don't know why this would be ... as far as I know there are no permissions I have to give it, this computer and file system is about as secure as a gazebo.

~Elvenfyre


Old Post September 07, 2005, 02:19:07 pm
#8
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
Since I'm a little stuck on importing weapons from a file and I really want to do that, I've decided to start tackling this whole shop system issue from the top down now that I am getting my head around subroutines - and what ones I'll need to make this thing work.

So I've got a subroutine for building the blue boxes with the borders that make it look shining-force-esque
Come up with a speech script for the chit chat so I can modify it as time goes by to have it make little bubbles of sound and take its time "speaking" (typing out the words) - for now it just uses the right font in the right place.
And I've used my buy and sell interface buttons and made a toggle for that with the up and down keys, and pathing so you can cancel and confirm at each step.



http://www.jaesign.com/desmond/java/shops.html

this is a different link from those above since I've started a new class to begin again.

Next is entering the buy menu, displaying the class I made last night of items, and allowing purchase.

~Elvenfyre


Old Post September 07, 2005, 03:11:13 pm
#9
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
moved my previous paint job of the top menu into its own subroutine and pulled it into the Shops class, so you can now go one step further.



http://www.jaesign.com/desmond/java/shops.html

(sorry about the spam, but to be honest, if I wasn't bratwurstming the babysteps here I'd probably give up heheh, planning more than an hour at a time is daunting when it is this frustrating.  starting to become clearer now though)

~Elvenfyre


Old Post September 07, 2005, 03:36:58 pm
#10
Ty
Administrator
Shining Sideburns *

Posts: 837

Logged
My Java Experience
It certainly looks like you've got everything under control! That's a pretty sweet looking shop you've got there. Does this mean BABS will be getting a shop too Wink


Old Post September 07, 2005, 03:53:50 pm
#11
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
Yeah well as long as I can get these external files to write!
I'm sure once I get enough practise in and take another look at it I'll be able to figure it out.

the idea is that you have your own plaintext items file..

//types: sword, ax, arrows, staff, lancespear, etc etc
ShortSword.name="Short Sword"
ShortSword.type="Sword"
ShortSword.price=80
ShortSword.wimage="items\shortsword.gif"
ShortSword.attackmod=15;
ShortSword.defensemod=0;
(and so on and so on)

and you write these out for each item you want in your game inside the one file.  your party who are equipped with whatever weapons pull the info from this file, and so do shops.

You also have a plaintext shop file, which you give each shop a name (town based, presumably) - and then you just list what items it has.
Pacalon.name="Pacalon Weapons Store"
Pacalon.type="Weapons"
Pacalon.item.1="ShortSword"
Pacalon.item.2="SilverArrows"

doing this for each shop.  at first glance it means short swords cost the same price everywhere, but you could be smart and give it a different variable name(ShortSword2, say) and leave all of the info the same except price.

I've just completed selecting a weapon and the Yes-No menu for buying it.  Will just complete the yes selection routine to modify your gold and take you back to the buy menu, and then post the screenie.

~Elvenfyre


Old Post September 07, 2005, 04:14:14 pm
#12
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
ok so I even managed to put in similar nuance as shining force to try to keep the feel, when you decline to purchase a weapon you're looking at.
I also managed to make it figure out whether you have enough gold to buy it before reducing your gold by that amount.

I'm not sure whether I'll work on incorporating the whole "who gets to hold the item" thing just yet, or whether I'll go back to making the outside files work.. we'll see.  I wanna give the external files another bash but I don't hold much hope.



http://www.jaesign.com/desmond/java/shops.html

YOU CAN NOW BUY THE STUFF Cheesy

~Elvenfyre


Old Post September 07, 2005, 04:17:09 pm
#13
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
as a side note, my firefox doesn't seem to be refreshing the page to show the newer version.. I don't know quite why that is it's possibly because java virtual machine is being a bitch (i do know this shop only works with the latest jvm, when i got someone else to test it earlier they had to update)

My IE however is refreshing and using it fine after a CTRL-Refresh.

weird.

edit: I think it was because i wasn't closing all my firefox windows before reopening to view it.

That's it for the night for me, tiredness has just hit.

~Elvenfyre


Old Post September 08, 2005, 02:34:38 am
#14
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
Right instead of doing work today I started doing this haha.

So I've managed to prove effectiveness of the system by implementing 3 shops.

Now the gold you get lasts for the entirety of the Load - so if you visit more than one shop you only have what gold you kept from visiting the other shop.

So pressing 1, 2 or 3 in the initial black screen is meant to have the same effect as visiting different towns weapon stores.

http://www.jaesign.com/desmond/java/shops.html

I think I'll give the external file thing one more shot now.

~Elvenfyre


Old Post September 08, 2005, 06:27:59 am
#15
Administrator Shining Spammer *

Posts: 1,129

Logged
My Java Experience
Another update.
So I've built a Party class in order to make sure my items are working and finish off the shops processes.

Now you designate who holds the item, it checks whether you're the right character type to equip it, and asks whether you want it anyway, if you want it equipped if you can, and also checks if your item slots are full.

I've still got to make equipped icons and show the modifiers for an item if it's equippable (like attack 42->45 rather than the word "equippable").

Now I've got to work on the sell menu using the same party item system and probably will incorporate a new feature in shops, being sellpercentage so that you can get more for your old sword in tassar than you do in milton.



http://www.jaesign.com/desmond/java/shops.html


Oh one other thing of note, I've increased the height of the window to 375, so that I've got an aspect ratio of 4:3.

~Elvenfyre


Pages: [1] 2 Print 
« previous next »
Jump to:  

Powered by SMF 1.1.21 | SMF © 2013, Simple Machines