General > Features & Articles

Advanced Development Tutorial for FOnline

<< < (3/3)

First things first. This, as well as the Mysterious Stranger is more like a module, rather than a tutorial, as it's complexity is too high to be of any proper use to teach stuff. Sorry about that.

7. Black Jack card game - Installation

Copy the following files to the "Server/scripts" folder:

* blackjack_manager.fos - manger class for the Blackjack module.
* blackjack_h.fos - contains specification for the Blackjack module.
* blackjack.fos - contains the the Blackjack class, the main mechanic of the Blackjack module.
* blackjack_dialogues.fos - contains the link to the dialogue file.
* blackjack_card.fos - contains the card class used by the Blackjack module.
* blackjack_deck.fos - contains the deck class used by the Blackjack module.
* blackjack_shoe.fos - contains the shoe class used by the Blackjack module, a shoe in Blackjack is a number of card decks shuffled together.Copy the following files to the "Server/dialogs" folder:

* blackjack_dealer.fodlg - the dialogue file for the dealer.
To complete the install, you also need to link stuff together, discussed several times in basic tutorial, like add "blackjack_dialogues.fos" to the script list, so the dialogue file can reference to it's scripts, you need to define a dialogue number to use the dialogue with and you need to create a map with an NPC or just add the dialogue to an NPC in a public map to try it out.


- To help testing of rare cases, you can find some use cases on the bottom of the blackjack class. I left their calls commented out, so you can see where to put them, but it's basically at the end of init.

Current situation:

- Some features are not implemented and I will not implement them myself, that remains to the player. The split, basic function of Blackjack is cut out, because it produces a lot of complexity and I did not bother to implement it. Other than this, every function works, but it is not as configurable as promised, someone wanting to assign quests to this module, will have to work him/her self on scripting.


- Fixed a a bug where when shoe ended there was no reshuffling.
- Added a few RP elements, shoe size can be seen, dealer's hole card can be seen and when shuffling happens, can be seen, depending on gambling and random check.

8. Adding or modifying sound effects.

Modifying a sound effect - drinking nuka cola:

* Download and convert a sound to .ogg format.

* Search youtube for a sound effect that suits you. (Example: "_" - Opening bottle sound effect - Blopp )
* Go to an online youtube downloader to download the sound in .mp3 format.  (Example: video grabby )
* Use an audio converter to convert from .mp3 to .ogg format. (Example: I used VLC, you can follow "_" this tutorial for it.)
* Once you got the .ogg file, test it with Winamp or VLC, and copy it into the "client/Data/" folder. (note: I used TotalCommander to copy files into .zip archives, it's easy with it, just browse the .zip file and copy the stuff into it, just like you would to a normal folder.)
* Edit the file "drugs.fos", change the line 91 from "cr.PlaySound("nukacola.ogg", true);" to "cr.PlaySound("blopp.ogg", true);"
* Test.
Testing it:

* Once you logged in with your admin character, type the command: ~getaccess admin admin (In case you changed the admin password, use different password, if in doubt check the GM abuse tutorial at questions and answer section)
* You should get a message on top of the screen stating: "Mercenaries don't die - they just go to hell to regroup."
* Type "`give PID_NUKA_COLA 5 -p AdminCharName -legit" - this will give you 5 nuka colas. (Make sure you replace AdminCharName with your character's name)
* Drink a nuka cola and listen. The new blopping sound should be in effect.


[0] Message Index

[*] Previous page

Go to full version