Wednesday, December 11, 2013

Dusk script hacks on the 'onBattle' script. Puzzle script's and flans to eat. Dusk news and Lou's Dusk Tactics. More water animation work.

I hacked a 'onKilled' script into dusk using the 'onBattle' script in Dusk.  So I am a hacker now! :-)  I referred to it at first as being sneaky with the dusk's scripting language but the developer 'NotZed' said and I quote, "In programming we'd call that a bit of a hack - not that there's anything wrong with that."

Eat Flans for breakfast

The first mob I wanted to run an onKilled script for was the flan.  There's 'hunger' and 'thirst' conditions in Dusk and I remember somebody complaining about them so I decided to make a mob that once killed would remove the 'hunger' condition from the player if they had it.   Here's an explanation and links to the scripts on how I did this.

Flan mob  -  Here's what a mobs format looks like.  Notice the onBattle script on the bottom

flan_brain  -  (Script) I used the onBattle script here to give the player 2 conditions: 'flanfood1' is the first regular condition which initiates the first conversation, the condition 'flanfood' is more complicated.

flanfood  -  (Condition) The flan_brain either gives or takes this condition away from the player every round of battle.  So it's basically telling the player to run this script 'eatflan' every turn the mob has in-battle.

eatflan  -  (Script) This script runs every single click in battle checking if the mob is less then 1hp and if the player has the condition 'hunger'.

That's it!  2 scripts and 2 conditions twisted together to imitate a 'onKilled' script which currently doesn't exist in Dusk.  (Note: this will only work fighting 1 mob at a time with this kind of brain.  So these mobs can't have "factions"- this makes mobs aggressive and charge the player if they are on the faction list.)

Now you can get rid of those negative hunger points anytime you see a Flan, just eat it!

Kick a ball around mushrooms to solve a puzzle

I've been trying to bring more 'RPG features' into Dusk since my blog is called 'duskrpg' and I don't want to be false advertising because Dusk was designed as a GMUD game of the late 90's.  A RPG game has features like puzzles and character management.  Dusk has the player management features but no kind of puzzle's so I decided to script a puzzle in my Duskmoon demo game.

The idea or inspiration of the puzzle was taken from Bertram's awesome JRPG Valyria Tear , it's a puzzle where you have to kick a ball around obstacles (mushrooms & dead mushrooms) till it lands on the trigger.

This puzzle took me probably ~30 hours to script!  I poked at it gradually over the last 2 weeks and now it's finally finished.  It would have been easier if Dusk was an offline game but as it's an online game it's necessary to clean up the puzzle in-case somebody logged out or died during it.  So I basically scripted a 'scripted event' in Dusk which makes Dusk WAY more RPG-ish.  Every possibility is scripted except for 2 and one is scripted but in the form of a punishment to the player for kicking the ball obviously the wrong direction.  Here's how I did this.

The ball's 'technology'  -   This is the boss script of the whole puzzle.  This is what took the most work.

Clean-up main   -   The main clean-up script that removes any possible conditions from the player.    

Clean-up last  -   This is the last script that has the smarts to know where to properly send the player.  (See the check for conditions close to the end if your a 'ballidiot' you get sent to the GarbageMan to die ...)

Plus about a zillion more scripts but those are the main ones.

This puzzle is part of a quest to save Krista's dad/ Kristina's husband.  The quest is available after doing Krista's quest and it's given by Krista's mom who is bed ridden in their house.



Here's a screenshot of the puzzle.  The whole area doesn't fit in-screen so if you want to see the rest you're going to have to play the game to see it!

If you just want to check out the puzzle quickly and not play-through hours of the game to become strong enough to get here, then you can log in as 'zabin' and password 'wassup', he's there at the beginning of the rabbit-hole surrounded by hallucinogenic mushrooms.

(If you find a bug in the puzzle -I haven't tested every possibility- please let me know about it!)

Dusk news and known bugs
 
-  I scripted a mob 'rocks' that once attacked will cause the player to flee unless a pickaxe is in their inventory.  I wrote a funny dialogue that says flint or something got in your eyes and suggesting to use a pickaxe.  I'll blog more on that later as I still have to setup a furnace for smelting and anvil for blacksmith.  So the scripts for mining, and blacksmithing is just beginning WIP.

Here's a todo list and known glitches  Once I've completed most of the things on the todo list I'll be happy to say that my game has reached the first episode!  Before I can say that though, the game has to be playable online and that's where the main problem is currently.  This is a problem I can't fix because I have no knowledge in Java programming.  The Dusk applet isn't loading images online (rarely it does work) because Java doesn't support the old loading method Dusk uses.  I think that's how Andy explained the problem.  The only thing I can do to fix this problem is by posting about this Dusk project on freegamedev.org, seeking Java developers who may be interested in working on an open-source game like this.  I don't want to pester NotZed (this problem is in the old Dusk files that run my Duskmoon demo) because he's busy with his fork 'DuskZ' and other hobbies he's into (DuskZ probably doesn't have a problem with the applet loading since he's upgraded to all new Java).

Dusk Tactics

Dusk Tactics  Lou's site, I've kept a link to it on the side bar ------->  .  This is Tom's old Dusk website "dusk.wesowin.org" but the name of the game there now is subject to change as this game is not the Dusk game that used that address back in the day.  It appears he's been updating it for almost a year but I never seen it until now.

Dusk inspired Lou to get into game development and he made an upgraded version of Dusk back in 2006.  I tried my best to get my hands on his upgraded files but he lost them unfortunately.  He told me a year ago he bought the old Dusk website in order to revive the old Dusk game.  He was working on a new version of Dusk (again).  I'm afraid he might have been using the buggy SourceForge files and I told him they were buggy(which may have caused his abandoning Dusk again).  We communicated a few times through email but then his Dusk forums went down and he never answered anymore of my emails.

Back then he told me about his new game 'Dusk Tactics' so I figured he was just too busy working on that and didn't have any time for Dusk.  I see his new email on that site and I hope he answers my email about possibly helping fix this problem in Dusk.  Hopefully he is still willing to help revive this old Dusk project.  Lou might be curious in NotZed's work on his fork.

Check out that Dusk Tactics link, it's very exciting and interesting!  I am looking forward to his new game and hopefully he still has interest in reviving the old Dusk game!  He's looking for a pixel artist to help create units and basically all art assets because the art he currently has is placeholder.  So email him if your an interested pixel artist.

(Update:  Found this link to more Dusk Tactics info and read about another game called Island Forge which also looks very interesting)

Water animation update

NotZed talked about making a tool which would show animated tiles in motion in the Tiled map editor.  I couldn't wait anymore so I built this test(which took me way too long) so I could see what the mouth of the river would look like.

I feel pretty good about the beach waves crashing animation.  The things that definitely need to be polished are:  the river's shallow/deep water animation, and the sand's alpha transparency fade is a bit too pointy where it blends at the mouth of the river.


The river may look better if that animation was slower but it doesn't look smooth at all so I'm going to work on that part of the animation again.


The water edges have been alpha blended so it'll work for a variety of ground tiles.

More Dusk ramblings

I wrote a bunch in the 'onStart' script though I may decide to take most of that out because it doesn't really belong there.

I thought it'd be nice to mention all the games I look at for inspiration and motivation for me to work more on Dusk.

DuskZ-(2013) -

Michael Zucchi aka (NotZed)'s fork of the old Dusk engine.  The old Dusk engine has recently seen some new life.  NotZed's work on DuskZ: completely rewritten the client/server with new Java/JavaFX for the client.  Almost every feature I had on my wish list for Dusk he's implemented in his DuskZ.  Animated tiles, animated damage bubbles, layers, players not getting resized, and better walking animation.  Those are some awesome new features in DuskZ but there's hardly any game content left as he's changed the scripting language from the old Dusk script to Javascript.  He started converting a few game scripts while testing his new Javascript system and he says he may still change it.  There's no point in converting the existing scripts until he has solidified his new scripting system.   He put together a runable version of his latest code (it's currently on googlecode) so I could check out the cool new features.  I thought his new version felt slick, new, and was obviously using new Java technology which was nice to see from such an ancient game!  I enjoyed seeing his upgrades though his new game is very incomplete and still needing more work, and polish till it's at a playable version.  Dusk is a big project and it's a lot of work.  I remember him saying that he isn't promising anything (so he might not finish a compatable/complete version of his Dusk).  But if he does it will be excellent!  If he doesn't oh well that's why I love open source, somebody else could learn from his work and possibly continue it.

I plan to make a video showing off the cool new features in his DuskZ but I haven't got around to making any new videos yet.

The Mana World-    

Great open source MMORPG. I mapped the starting village in Duskmoon to resemble TMW Hurnscald, which I believe was mapped in TMW by Crush.  The farmer quest to kill the pinky's and rewarded the farmer's kaiser blade (in TMW)- inspired the bug hunting quest in Duskmoon.  Monster points idea (TMW) inspired me to do the same in Duskmoon.

I haven't played this game since 2008 but I like to check in on their progress once in a while.

Valyria Tear-

Bertram's excellent JRPG.  Watching him revive Hero of Allacrost (HOA) with his fork of the game (by himself) inspired me to revive Dusk.  Ball, triggers, and giant mushrooms blocking (Bertram's puzzle idea) inspired my own version of the puzzle in Duskmoon.

I really enjoy seeing the art I make being put to good use in his game!

Battle for Wesnoth-


Huge excellent open source game with tons of excellent art all licensed under a open license (GPL) some of which is used in Duskmoon.

My dad plays this game ALOT and I don't blame him as the battle system could be quite addicting.

 Wyvern GMUD-

I was searching the internet looking for a game that resembled Dusk and I found this gmud.  It's not open source and I haven't played it yet because the guy who made it is currently not hosting it online (hasn't openly licensed it either).  So no one could revive it besides him.  I was reading through their forums and noticed everybody there were old players who miss the game and are anxiously waiting to play the game again.  Which is how I feel about Dusk.