As a sign that yeah, I'm still alive, I've added a new feature. This also allows me to demonstrate a few things that are possible in JA2 but are never used elsewhere. Hopefully this will lead to a few fruitful new ideas.
Anyway, as a new addition to interactive actions, we can now play minigames.
I've set this up to work at arcade machines, but as you already know, you can set this up to work on any structure via xmls and lua scripts.
-- We have an array of 1000 signed integers that a modder can use to set whatever data he wants.
-- We simply set up some enums here to make it easier for us to remember what is what
ModSpecificActions =
{
...
-- |||||||||||||||||||||||||||||||||| minigames |||||||||||||||||||||||||||||||||||||
MINIGAME_TETRIS = 50,
...
elseif ( usActionType == ActionTypes.ACTIONTYPE_MINIGAME ) then
-- for now, the only game we have is tetris
if ( sLuaactionid == ModSpecificActions.MINIGAME_TETRIS ) then
-- playing a game costs $1
if ( SoldierSpendMoney(ubID, 1) == 1 ) then
Tetris works the way you'd expect it to work. The arrow keys allow moving and rotation the controlled tile. Placing tiles fast and completing lines gives you points. Finishing lines increases the level, making the game faster and giving you more points. You can increase the starting level or add an additional challenge by raising the handicap (for each level, 2 partially filled lines will be added). [p] pauses the game, [Esc] quits it altogether.
Of minor interest to coders might be that the background images are in png format, not sti. While we can already use png background images, I've found no evidence we ever do so, at least in the trunk. So take this as a nod to that ;)
The most interesting part of this is that the coding methods used here (create a new screen type, use png images as background, create menus, use timers to simulate movement...) could also be used elsewhere. A few ideas (doesn't necessarily mean I'm going to implement them):
More minigames. Duh.
Hacking so far only results in a few lines in the message box. A dedicated computer screen would be cool.
It's pretty obvious we could use this and a few lua additions to be able to allow modders to put up pictures. So for example, you could walk up to a picture in a house, inspect it, and suddenly you can see the image in large.
Seemingly every RPG out there has minigames. Picking locks. Hacking. Crafting. Cooking. It's a meaningless, trite waste of time, and we could have that too! Just imagine, every time we pick a lock, we have to do a lockpicking game first! Maybe this is not such a good idea
Among the many ideas the new X-Com had that sounded good on paper but where bad in the finished product was air defense (which was just an impressively bad minigame). We nowadays can repair/hack SAMs, and have actual enemy targets we could shoot down...
This feature has been added to the trunk in r8346 & GameDir r2350. This is fully savegame compatible. Using the new exe without the new GameDir will cause your computer to gain sentience, briefly ponder upon the feebleness of mankind, and then run off to Slovenia with an overweight baton twirler. Ouch!
[Updated on: Sun, 11 December 2016 14:23]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
Messages:344
Registered:July 2006 Location: France
Quote:
Hacking so far only results in a few lines in the message box. A dedicated computer screen would be cool.
It's pretty obvious we could use this and a few lua additions to be able to allow modders to put up pictures. So for example, you could walk up to a picture in a house, inspect it, and suddenly you can see the image in large.
For immersion those two uses would be very nice.
Minigames are harder to implement in JA2's gameplay where you're not acting directly but giving orders to others, acting in your stead. Their success depends on their abilities, not yours. Though, one could imagine ponctual minigames based on intelligence (intel, information) for example.
It was long time ago on Metavira. Where lockpicking shows a little video with a keyhole and lockpicking process... It was cool. Maybe not a minigame, just such small animation will be added someday? Excellent job!
As of r8353 & GameDir r2353 (awww, exactly 6k difference), we have another minigame, this time an even older one:
It's a real classic this time. With a few upgrades:
A ball only scores after it has been touched by a player paddle at least once. Point goes to the last player that touched it, own goals are not possible.
You can set the max speed of the balls. Note that balls automatically speed up the longer they are in play, we can't have you relaxing, can we now?
1 Ball is normal, but you can increase that up to 100 if you like.
Multiplayer: Up to 4 players can play this game at the same time with one keyboard (key bindings are listed on the side when needed). This means that we finally have a multiplayer game for this year's convention!
The AI also has a hard mode. Which is harder than easy mode.
Anyway, while this is hardly exciting, I guess I'm a bit more comfortable with collision and angular movement stuff now, which would be somewhat useful for other thinkable features.
GameDir >= r2353 is required for this (new .png image added, lua and xml settings). Using the new exe without the new GameDir is for losers. So sad.
Edit: Why is there no 'party' smiley here? Sad.
[Updated on: Thu, 05 January 2017 01:15]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.