Knights Forum

General Category => Knights Discussion => Topic started by: ImpassIve_rus on October 18, 2012, 09:21:35 PM

Title: [Mod] Heroes
Post by: ImpassIve_rus on October 18, 2012, 09:21:35 PM
Heroes v1.1
(http://i.imgur.com/Fj90bKE.jpg)

Last update:
June 26, 2014


Description
This mod adds a new game type - Heroic quest.
Main features are:
1) New monster type (available only during this quest) - Barbarians. Fast, strong and furious. (Or, at least, they supposed to be such)
2) No unlimited respawn. The death is permanent.
3) New items:
   - Barbaric gem (tiny violet gem) - can be picked up from a barbarian's corpse. You will not lost them after death.
   - Reviving gem (big red gem) - you can carry only one in a same time and you can't drop it (will be dropped after death). Allows you to revive once.
4) Victory condition - you should obtain 6 barbaric gems without being killed. (in fact, you can still win by eliminating all other knights, but I am not able to fix this)

To-do list
1) Any display of other's score.
2) A special room for barbarian's respawn (something like their base).
3) Medkit, shield and some other stuff.
4) ??

Additional notes
- Did you know... what barbarians can be trapped using bear trap?
- Amount of barbarians depends on number of players and can't be changed.
- Use 'number of gems' field to determine amount of reviving gems.
- This mod requires Toolbox mod of, at least 2b version (current version... 4.1).
- If you are using dev (http://www.solarflare.org.uk/snapshots/) version of knights, you can unlock a 'Heroes++' mission type. You can do this by editing 'config.lua' file and setting up 'DEV = true'
    At this moment I am making a ranking system based on this type of mission.

Known bugs
- There are some troubles with combining gems of barbarians killed in motion. Solved?
- If you will "override" barbarian's corpse by killing another creature on the same tile - barbaric gem on the floor will be lost. Solved?
- It is incompatible with Romanio's Rat Rider (http://www.knightsgame.org.uk/forum/index.php?topic=233) mod. For this reason I forbid players to add any rat riders during heroic quest.
Installation
1) Download and install toolbox mod (http://www.knightsgame.org.uk/forum/index.php?topic=223) first! If you already had it - make sure that it is up to date. (at least 2b version)
2) Download "heroes_0E.zip" from attachments
3) Unzip it into "<path to your knights>\knights_data\server"
4) Put 'require ("heroes")' line into "knights_data\server\main.lua"

____________________________________________
Any questions, comments and suggestions are welcome.
Feel free to study and use any part of the source code.
Title: Re: [Mod] [WIP] Heroes
Post by: Moo on October 18, 2012, 10:22:05 PM
Very nice  :)

It seems to sometimes not add the gem amount when I pick them up though... For example, I find one gem, it says I picked up a gem, total:1. I get another, it says I picked up a gem, total:1 again. I've even seen it say total:0 when getting first gem.
Also it seems killing barbarians sometimes doesn't add to the number of gems in that spot either.
Title: Re: [Mod] [WIP] Heroes
Post by: ImpassIve_rus on October 19, 2012, 12:21:26 PM
I tried to reproduce this bug, but was unable to do this (will try again, maybe, using crossbow/throwing axe instead of just a sword).
Anyway, I have some suggestions about that - and found another bug, caused by the same error.

1) If you killed a barbarian and got his gem - you can bring on this tile another barbarian and kill him - in this case you will get 2 gems instead of 1 (3 instead of 2 in total), and so on. I can fix this.
2) Also, getting '0' gems can be fixed.

But I still don't know the root cause of this problem.
Can you in detail describe the situation?
Do you have any other mods installed, who killed this barbarian, was he (barbarian) standing or moving at this moment and so on.
Title: Re: [Mod] [WIP] Heroes
Post by: ImpassIve_rus on October 19, 2012, 12:27:08 PM
I have changed one function. Please, try this again:

P.S. Main thoughts about cause of this bug are:
1) A barbarian was killed while moving, so, information about his corpse for some reason was written by my function in a wrong slot.
2) Maybe, he was killed without sound? (I should try some wands on it)

UPD: I have found another possible cause of the bug:
I was using "cxt.actor" after calling "Delay" function. That was my fail
Title: Re: [Mod] [WIP] Heroes
Post by: Moo on October 19, 2012, 02:56:47 PM
Ok, using 0c I was able to isolate one issue - killing a bat or zombie on a square which should have gems erases them. You get no message about picking up a gem.

So this wasn't my original issue, but that seems to be mostly fixed now. The only reliable thing I've managed to find for that in 0c is when you kill two barbarians in the same place using the wand of destruction, you only get one gem. I think I've had similar things happen at other times too, but hard to tell really, and certainly much less than I was having with the original version.

One other little issue; if there's a dead barbarian in a doorway and you close the door, the corpse is drawn on top of the closed door.

Title: Re: [Mod] [WIP] Heroes
Post by: ImpassIve_rus on October 19, 2012, 03:36:55 PM
1) Killed 3 barbarians in the same tile using wand of destruction but got only 2 gems. The problem is located, so it will be easier to fix it.
2) Yes, a problem with other corpses overrides barbarian's corpse exists. "Pick up a gem" event linked to <Tile>.on_walk_over function. So, no corpse - no gems.
I was supposing to implement barbaric gems using items (just as reviving gem), but there is a problem, because kts.PlaceItem
Quote
If an item is already present at the given location, then this function will fail (and return false).
So it is hard to place gem(s) in one particular spot.

UPD: yes, as I have supposed, if a barbarian will be killed while moving (usually happens while using powerful weapons, such as wand of destruction) - hook "HOOK_CREATURE_SQUELCH" will get (at least, sometimes) an "old" position of this barbarian while the corpse in fact will be placed in the next cell. I don't know how to solve such issue. Possibly, I will have to do add more complex checking to this function.
Title: Re: [Mod] [WIP] Heroes
Post by: ImpassIve_rus on October 19, 2012, 04:36:50 PM
Ok, the last snapshot for today (I will continue bug-fighting tomorrow)

- Removed wand of destruction (1 - it will be harder to cause a "killed in motion" bug, and I will try to fix it later. 2 - too easy to kill 6 barbarians using it. Not interesting).
- Added "Debug" option. Edit config.lua and set DEBUG_ENABLED to true. If you would do so, you will not be eliminated after death and you will get some debug messages.
- A first attempt to fix "replacing corpse" bug. If some creature (not a barbarian) was killed, and there were barbarian's corpse - the mod will try to place a new barbaric corpse over it. May cause a duplicating if combined with "killed in motion" bug. Also, not stable.

(ah, that is sad, that we don't have a separate "CREATURE_DEATH" hook. In that case "killed in motion" bug would be auto-fixed)

P.S. Note: 0d (just as other versions) is unstable. I will improve the code today (have several ideas)
Title: Re: [Mod] [WIP] Heroes
Post by: Stephen on October 20, 2012, 12:54:41 PM
Very nice work ImpassIve! I will have a look at this later :)
Title: Re: [Mod] [WIP] Heroes
Post by: ImpassIve_rus on October 20, 2012, 07:00:56 PM
I have made a new 0E snapshot.

I hope, it will fix current bugs.

P.S. Moo & Stephen - thanks)
Title: Re: [Mod] [WIP] Heroes
Post by: Moo on October 21, 2012, 11:08:16 AM
Yes, I haven't been able to find any problems with this version.
Title: Re: [Mod] [WIP] Heroes
Post by: doublejack on October 22, 2012, 05:20:42 PM
added to modlist
Title: [Mod] Heroes v1.0 is out!
Post by: ImpassIve_rus on October 25, 2012, 12:48:02 PM
Heroes v1.0 is out!

Since those pesky bugs were removed I decided to clear [WIP] tag.

Also, some changes were made in this release:

1) In 'Heroes' mission some restrictions were decreased.
Just as it was before v0E, you can use Wand of Destruction again, "Tiny" size of dungeon is available and some other...

2) Romanio have released his "Rat Rider" mod today. Unfortunately, these mods are incompatible now (because they both using kts.Delay to detect creature's death. This problem would be solved by Stephen's Monster Proposal (http://www.knightsgame.org.uk/forum/index.php?topic=232.0) ). For this reason you can't place rat riders during heroic quest.

3) I began making 'Dev' version of the mod. It uses some functions what are not implemented in current 21 release but already exists in dev versions of knights.
It is in testing right now. A bit more information about this can be found in the first post (additional notes).
Title: Re: [Mod] Heroes
Post by: Stephen on October 25, 2012, 04:30:10 PM
I tried this, it is quite good fun. Would be interesting to try as a multiplayer game.

I didn't find any bugs.

The permadeath is interesting... for example, drinking potions is risky (without a reviving gem) because if you get poison, then it's game over :)
Title: Re: [Mod] Heroes
Post by: Moo on October 25, 2012, 05:03:43 PM
The revive-gem system works very nicely to make a challenging single-player knights game, but I think there could be problems for multiplayer... We'll see, I guess.
Title: Re: [Mod] Heroes
Post by: ImpassIve_rus on October 25, 2012, 05:18:22 PM
Hmm ... Yes, it seems to be true. =(
There is way less direct interaction between players... Because they will either kill each other (and the game will ends pretty fast for one of them) or they will try to co-operate against barbarians (especially if there is no reviving gems in the dungeon)... but there is  no strict reason for cooperation because even single player with a bit of luck can kill them all and win.

P.S. According to the original idea, all players should be in the one same team. But I have tried to do this... The game finishes with "Win" message as soon as anybody dies, because obviously there is no 'opponents' (members of other teams) alive.
Title: Re: [Mod] Heroes
Post by: Moo on October 25, 2012, 06:06:49 PM
The game finishes with "Win" message as soon as anybody dies, because obviously there is no 'opponents' (members of other teams) alive.
Yes, it would be nice if there was something that could be set that would prevent that. This would also mean that for multiplayer, killing the other player(s) wouldn't mean you'd automatically win.
Title: [Mod] Heroes v1.1
Post by: ImpassIve_rus on December 31, 2012, 12:23:45 PM
Heroes v1.1 is out

Since Knights version 22 was released, I had to make some changes in code to save compatibility.

Note what:

1) "Heroes++" is now the only available mission type (basic "Heroes" was removed).

2) I had some thoughts about ranking and money systems. They are in the game now, but they have no purpose yet.
You can disable these annoying notifications by editing "config.lua" file.

Happy New Year everyone!
Title: Re: [Mod] Heroes
Post by: K9 on May 19, 2013, 01:01:19 AM
ImpassIve_rus, I'm embarrassed to say I finally had time to really spend some time in this Heroes ++ v1.1 mod and actually enjoy completing a few games. 

Although I quickly checked it out some 5 months ago, I'm just saying it now, ditto to Stephen's comments - very fun and interesting single-player quest with your custom ideas.

Thank you!



Also, missing you and Romanio on the weekend quests - hopefully see you both again sometime...


Title: Re: [Mod] Heroes
Post by: ImpassIve_rus on June 19, 2013, 06:50:04 PM
K9, thank you!)

Anyway, I can't promise anything right now.
I have really much trouble with exams right now and I'm already close to panic...))

So I still can't continue developing any mods and/or attend weekly games in near future.
Title: Re: [Mod] Heroes
Post by: Ushiri on August 22, 2013, 01:27:33 PM
I cant actually find the "toolbox mod". the link to that download is not there.. or at least not in the first post about the subject. where can I get it ?
would love to try your mod.
Title: Re: [Mod] Heroes
Post by: K9 on August 22, 2013, 03:01:03 PM
I cant actually find the "toolbox mod". the link to that download is not there.. or at least not in the first post about the subject. where can I get it ?
would love to try your mod.



I'll respond since ImpassIve_Rus has been offline for awhile, internet issues.

There is a sticky forum on main page that contains all mods in nice organization to find, with links, setup by doublejack.  Here is the menu path:

 Knights Forum » General Category » Knights Discussion » mod list


Thank you...
Title: Re: [Mod] Heroes
Post by: ImpassIve_rus on August 23, 2013, 11:15:31 AM
I cant actually find the "toolbox mod". the link to that download is not there.. or at least not in the first post about the subject. where can I get it ?
would love to try your mod.

Also, you could find it in my signature (yes, that's a link to the corresponding forum thread):
(http://s002.radikal.ru/i197/1308/91/98980488efb7.jpg)
Title: Heroes
Post by: ImpassIve_rus on June 26, 2014, 10:38:14 AM
Not a real update, but since it is compatible with Romanio's Rat Rider (http://www.knightsgame.org.uk/forum/index.php?topic=233.0) mod now, I removed corresponding restrictions from code.