Here's the completely pointless first result of my venture into OpenTTD scripting: Whack-a-Tree.
How to play:
1. Find a 5x5 area that can be safely demolished.
2. Place a sign in the middle and label it !play
3. Pick your favorite demolition tool and whack away at them trees!
You can cheat by constantly clearing the whole area, but I couldn't decide on any not-to-whack element to randomly spawn. Other than that, the game only wastes your time and money, but it serves as a proof of concept for games using NoGo.
Note to script developers: The EventDispatcher, SignObserver and event classes are part of a library I started building. If you think they might be useful (I have StationObserver and HQObserver as well) let me know and I will release them as a library.
Edit: Setting the spawn chance too 100% causes no tree spawn at all. I blame GSBase.Chance().
[NoGo] Whack-a-Tree
Moderator: OpenTTD Developers
[NoGo] Whack-a-Tree
- Attachments
-
- whackatree-1.tar
- (16 KiB) Downloaded 140 times
- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: [NoGo] Whack-a-Tree
As "pointless" things go, i think this is a great little mini-game. Thanks for upload! 

High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS

My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: [NoGo] Whack-a-Tree
How about giving money back to the player based on some formula with the hit percentage (if that works) and the number of trees cleared in it? Of course, it would destroy the whole purpose by making it useful, but that's your decision 

--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: [NoGo] Whack-a-Tree
Tiny update - configurable radius. I wanted to make it catch cheaters (i.e. those who dynamite more than one tree at once), but it turns out scripts run much too slow for that. I haven't figured out a way to directly refund money yet either.
- Attachments
-
- whackatree-1.tar
- (30 KiB) Downloaded 118 times
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
Re: [NoGo] Whack-a-Tree
You blamed quite correctlySimn wrote:Setting the spawn chance too 100% causes no tree spawn at all. I blame GSBase.Chance().

Fixed in r24531.
Who is online
Users browsing this forum: No registered users and 13 guests