Doomy's Script Creations

8 replies [Last post]
doomy
doomy's picture
User offline. Last seen 3 days 10 hours ago. Offline
Joined: 2011-01-16
Posts: 132

A lot of these are just updated versions of old scripts (but almost completely rewritten). But there are a couple of new ones.

You can download all of them here.

To install, just put the hwp file into your Data folder:

GNU/Linux: ~/.hedgewars/Data
Windows: Documents/Hedgewars/Data
Mac OS X: ~/Library/Application Support/Hedgewars/Data

Or, if you want to install them individually, click the download on the scripts you want, then extract them into Data/Scripts/Multiplayer (DoomyUtils should just go into Data/Scripts)


Script Merger v2a

Download

Loads additional scripts using script parameters. This can theoretically load an infinite amount of scripts, but while this should work with all scripts, not all scripts will work with each other.

If you try combining map generation scripts, and it seems to load only one, try changing the order of them (eg. instead of script2=ShoppaMap,script3=DiagonalMaze try script2=DiagonalMaze,script3=ShoppaMap).
If that still doesn't work, there's not much that I can do about it.

Script parameters:

  • showMissionMode - Defines how Script Merger should handle ShowMission. 1 (Default) = Whichever script loads last has it's mission shown. 2 = Attempts to merge the texts of ShowMission. 3 = You can cycle through ShowMissions using [Switch] and [Precise] + [Switch](or with default controls, tab or shift + tab). If a script calls ShowMission anywhere besides onGameStart, it will not affect the others.

  • script2,script3,script4... - Loads additional scripts.


Doomy Utils (all scripts below require this)

Download

A utiliity API for scripters. Required for all scripts below.

I would write the 15 functions provided by this but I'm too tired right now. Maybe tomorrow.


Evil Weapons v2
"A game about Dynamite turning into Cheese"

Download

When you shoot a weapon, there's a chance it will turn into something else. This also works with flames spawned from barrels, molotovs, etc.

Script Parameters:

  • chance - The chance that when you fire, it will be replaced with something else (Default:33)

  • maxTriggers - The maximum number of times evil weapons can trigger in a turn (Default:10)

  • enableLandObjects(0 or 1) - If 1, this can affect barrels and mines

  • insanity(0 or 1) If 1, enables insanity mode. I was going to explain what it does, but then I thought it would be better to keep it a secret. Just for now at least. Enjoy!


Mass Destruction v2a
"Is it a mass amount of destruction, or the destruction of mass?"

Download

Everything is pretty destructive. That's it.

Script Parameters:

  • mode - The mode you want to play. 1 is normal, 2 is the original script effect, and mode 5 is one that creates a projectile that somehow destroys all land, because, why not?. Modes 3-4 are currently placeholders and basically disable the script.

  • destructiveMult - The destructive multiplier. In original mode, increases the number of things that spawn. In normal mode, this will decrease the delay between weapon effects. In mode 5, it increases (or, if destructiveMult < 1, decreases) the power of the projectile.


Voodoo v1
"Hey, why is everyone stalking me?"

Download

Any change in velocity from the current hedgehog affects all other hogs too. This may sometimes make a turn last indefinitely. Use at your own risk! This mode is best played with low turn time, so your opponent can't take his time making all your hogs jump into water.

Script Parameters:

  • updateRate - The time in ticks between voodoos (Default:1).

  • voodooMult - The multiplier for voodoo. 2 means hogs will move twice as fast as the current hedgehog, 0.5 means that they'll move half as fast.

  • disableFriendlyVoodoo(0 or 1) - If 1, prevents voodoo on friendly hogs.

  • disableHogVoodoo(0 or 1) - If 1, prevents voodoo on all hogs.

  • objectVoodoo(0 or 1) - If 1, allows any objects(mines, barrels, etc.) to also be affected by voodoo

  • insanity(0 or 1) - Once again, I won't explain the effect of this. Unless someone figures it out.


Crazy+ v2

Download

Most things that spawn is spawned randomly onto the battlefield. I don't know why I made this.

Script Parameters:

  • range - The maximum distance away from it's original position something can spawn

  • insanity(0 or 1) - If someone looks at the code to see what insanity does, I'll be disappointed.


Tornado and Broken Wind v2
"It's almost like the AI doesn't account for the change in wind.."

Download Tornado
Download Broken Wind

In Tornado, the wind is constantly changing from left to right.
In Broken Wind, the wind is randomly changing.

Script Parameters:

  • windChangeRate - The delay in ticks between wind changes (Tornado Default: 5, Broken Wind Default: 500)

  • maxWind - The maximum wind it can change to (Default:100)

  • minWind - The minimum wind it can change to (Default:-100)

  • insanity - I plan to have this in all my scripts.

  • insanityChance - The chance for insanity to occur upon wind changes

  • (Tornado only) windAmount - The amount of wind to increase/decrease by with each wind change (Default: 1)


Changelog

Script Merger

Quote:

Script Merger v2 --> Script Merger v2a
  • Added showMissionMode, allowing you to choose how ShowMission should be handled

Script Merger v1 --> Script Merger v2:

  • No longer requires DoomyUtils
  • Prevents scripts from using ShowMission while still showing important information about it
  • When using map generation scripts, the map preview now shows up in frontend
  • Tweak: Script Merger won't change your scheme and weapons to default when you switch to it

Mass Destruction
Quote:

Mass Destruction v2a:
  • Fixed occasional lua error spam when using hellish hand grenade in enhanced mode
  • Fixed Molotov Cocktail having no effect in enhanced mode
  • Added Skip
  • Now uses Goals rather than using ShowMission.
  • Second Melon Bomb in enhanced mode now keeps the timer of the first
  • "Enhanced" mode is now default, and original mode is mode 2


I plan to update all my other scripts too, but I'm also working on some new interesting ones.

Wuzzy
Wuzzy's picture
User offline. Last seen 29 weeks 2 days ago. Offline
Joined: 2012-06-20
Posts: 1304

Comments:



Script Merger:

YES! I have been waiting for something like this.
Of course, I have immediately tested this thing.

It works so far for a few “harmless” combinations. These script parameters all work as expected:
script2=DiagonalMaze, script3=No_Jumping

Highlander with no jumping mode!
script2=No_Jumping, script3=Highlander

Bubbles_v1 (map generating script) + No Jumping + RopeTrajectories (a script from from hh.unit22.org) + WxW:
script2=Bubbles_v1,script3=No_Jumping,script4=RopeTrajectories,script5=WxW

Fun times begin when you start to combine map-generating scripts.

This combines the land output of Diagonal and Tunnels:
script3=DiagonalMaze, script2=Tunnels

However, in reverse order, this does not work:
script2=DiagonalMaze, script3=Tunnels
This only generates tunnels. I don't know why. Could this be caused by the scripts themselves?

I can't combine Holes_v1 and Tunnels no matter what:
script2=Holes_v1, script3=Tunnels
script3=Holes_v1, script2=Tunnels
Here, only script3 “wins”.

Well, I guess map generating scripts are just not meant to be combined this way and there is probably not much you can do about it. Anyways, it's not that important.

It does not seem to work together with any script which uses script parameter. My first try was with Game Hacks:
script2=DiagonalMaze, script3=Game_Hacks_v17, gravity=150%

I expect to see a diagonal maze (which appeared) and the gravity of 150% (parameter read by game hacks). But only the diagonal maze appeared. I know Game Hacks was loaded successfully since I have launched . This is an unique little feature from Game Hacks.
If I flip the script order, it still doesn't work.

DiagonalMaze + Gravity does not work either:
script2=DiagonalMaze, script3=Gravity, g=150

I hope you can fix the script parameter issue. If this does not work, many legit script combinations are doomed.

Conceptual problems I see with the script merger:
- What to do if both scripts wants to set the text in the mission panel? This is pretty common. If I guess correctly, it's the script loaded last which will “win”, thus all texts from the previous scripts are lost. Same problem if one script uses Goals, but the other one ShowMission to set the mission text. Here, the script which uses ShowMission will always win, no matter the loading order, since if you used ShowMission just once, there is no going back. This is probably a shortcoming of the Lua API anyways since there is not much stuff you can do to modify mission texts more easily.
- The official script “Gravity” also uses the “script2” parameter. This is probably a problem. I suggest to make the parameter names of Script Merger unique. Just use a different key name
- Why did you move the actual code to DoomyUtils instead of putting it all in Script Merger? Won't that pollute _G with a ton of variable names (e.g. rawDeletedGear, GetGearInfo, etc.) and creating potentential name clashes? IMO Script Merger should keep the namespace as clean as possible, normally declare everything as local variable; only use global variables when you absolutely must. If there's a reason you want the actual Script Merger code in an external script, better create another file so you can keep it out of DoomyUtils.

Small suggestion:
- Set a global variable called “IsScriptMergerLoaded” to true. This variable could then be read by other scripts so they can react to it and maybe behave differently, if it is required. I think this is one of the few instances where using global variables in Script Merger is OK. But I am not sure if such a variable would ever be needed.


Mass Destruction v2:
- BUG: After throwing a hellish hand-grenade in enhanced mode a couple of times, I sometimes get Lua error spam in chat: “blablabla Mass_Destruction_v2.lua:55 attempt to perform arithmetic on local 'dx' (a nil value)”
- Mission panel of has a typo (“|” character apperaing in the wild)
- You should lock the weapon scheme as those seem to be fixed by the script.
This means the weapon scheme cannot be selected while this script is selected.
You can lock it by entering “locked” into the 2nd line of the config file.
- You should add Skip
- Molotov Cocktail is not special at all in Enhanced mode
- All information of the game scheme (e.g. mine time, vampirism on/off, karma mode on/off, etc.) are lost in the mission panel since you used ShowMission.

Gameplay comments and suggestions:
- “Normal” mode is WAY too destructive. It's fun to watch but pointless to play. Even with
huge landscapes it just takes 1-3 shots to destroy almost all landscape. Also, I wouldn't call this mode “Normal” Wink Smiley I understand this is the point of the script but could you at least make the other mode the default? It is more suitable for actual gameplay IMO, so you can keep the other mode for historic or whatever reasons Wink Smiley
- “Enhanced” mode is more interesting since it is not *that* overpowered.
- Melon bomb in enhanced mode: I suggest that the second spawned melon bomb starts with the same timer than the one the player has launched, i.e. if the player throws a 3s melon bomb, it creates another 3s melon bomb (instead of always 5s).
- Description could be better. I'd suggest you do not use ShowMission but Goals instead, since Goals keeps the original text, and appends to it, instead of replacing the entire text. Thus vital information like mines time, game modifiers, etc. is preserved. I would ONLY use ShowMission if the script undermines the entire gameplay, such as Construction Mode or Space Invasion. Setting Goals is more appropriate for scripts which do modifications on top of the game scheme settings.

“Normal” mode:

Quote:
Goals = loc("Mass Destruction: The weapons are extremely destructive, take cover!")

Enhanced mode:

Quote:
Goals = loc("Mass Destruction Enhanced: The weapons are very destructive, be careful!")

If the mass destruction factor has been set (unequal 1), append this line to the text:

Quote:
Goals = Goals + "|" + string.format(loc("Mass Destruction Factor: %d"), MASS_DESTRUCTION_FACTOR)

(Probably you need to tweak above code to insert actual variable names, etc.)



Crazy+ v2:
This mode is so silly its useless. Why would you want to randomly throw around projectiles?
Shocking
Not really useful for actual gameplay IMO, it's more a gimmick than anything else.

Other scripts:

They are just too random or too silly for me to be of interest. :P



General notes:
- Whenever possible, use Goals instead of ShowMission to set the mission text, in a similar manner as I suggested for Mass Destruction.
- Thanks for your contributions! Smile

Hi, I am a Hedgewars developer. Smile

doomy
doomy's picture
User offline. Last seen 3 days 10 hours ago. Offline
Joined: 2011-01-16
Posts: 132

Wuzzy allegedly wrote:
I can't combine Holes_v1 and Tunnels no matter what.

Unfortunately, due to the design of those scripts, I was unable to fix this problem. On the bright side, in my pursuit to fix this, I accidentally made Script Merger display the map in the frontend.

Quote:
It does not seem to work together with any script which uses script parameter.

Fixed.

Quote:
What to do if both scripts wants to set the text in the mission panel?

I had already thought about this, and now, it will take the last lines from each ShowMission called at onGameStart, and append them to goals.

Well, technically it appends them to Goals, and then I have to use a ShowMission that displays Goals, including any scheme settings.

Quote:
- The official script “Gravity” also uses the “script2” parameter.

It erases the script2 parameter after loading the script but before calling it's onParameters, so that isn't be an issue.

Quote:
Why did you move the actual code to DoomyUtils instead of putting it all in Script Merger?

I had originally planned to have it so all my scripts had a script merging feature, but then I created script merger, making it kinda pointless.
Fixed in this version, now Script Merger doesn't require DoomyUtils.

Quote:
(Insert mass destruction bugs here)

Fixed.

Quote:
Crazy+ v2:
This mode is so silly its useless. Why would you want to randomly throw around projectiles?

I added the range parameter to make it slightly more playable, but it's still pretty silly.

Wuzzy
Wuzzy's picture
User offline. Last seen 29 weeks 2 days ago. Offline
Joined: 2012-06-20
Posts: 1304

Mass Destruction v2a is much better now, thanks!

Just a few minor complaints:

Hmm, I am still not really happy with the Mass Destruction mode names. “Original” and “Normal” seem to be pretty generic names to me. Do you have better ideas? Here are my ideas:

Mode 1: “Armageddon”, since it destroys large parts of the world. Smile
Mode 2: Hmm, not sure. “Enhanced Weapons”, maybe?

Also, I would have liked if more if you added an actual description of the Mass Destruction mode, just a short sentence would be nice.

I noticed you can enter floating-point numbers for the desctruction factor. While I think this is a reasonable addition, this could be a problem in online play, ask nemo in IRC about this.
nemo told me that floating points are taboo in Lua for any gameplay-relevant variables. The reason for this is fear of desyncs in network play.

Script Merger v2:
Uhhhh, I think you should rather not touch ShowMission or Goals or basically interfere with what other scripts are doing. While I think the current ShowMission / Goals situation is a mess, there is probably not much you can do about it. If Script Merger messes with the mission text even more, it makes it even worse in most cases.

I'd rather wait until Hedgewars provides a better API for that stuff. I suggest you just let the scripts do their stuff rather than interfering even more by preventing scripts from doing stuff. Otherwise, the chaos just increases. I noticed that combining RopeTrajectories with Game Hacks v17 messes up the goals text. Please just leave it alone until a better solution is found.

OR: A compromise solution would be to add another script parameter for Script Merger to toggle this attempt to merge texts (because it can fail for many scripts). (Default should be off to avoid surprises).

I guess in the future most problems we'll have with Script Merger will be caused by the scripts themselves because they were never designed to be merged in the first place. But maybe they can just be redesigned for better cooperation.

Game Hacks and Gravity work now with script merger, thanks!

And yes, I know that it is not always possible to merge map-making scripts, but as I said, it's not a big deal.

IMO this Script Merger is already a really cool thing. Smile

Hi, I am a Hedgewars developer. Smile

doomy
doomy's picture
User offline. Last seen 3 days 10 hours ago. Offline
Joined: 2011-01-16
Posts: 132

Wuzzy allegedly wrote:
Script Merger v2:
Uhhhh, I think you should rather not touch ShowMission or Goals or basically interfere with what other scripts are doing. While I think the current ShowMission / Goals situation is a mess, there is probably not much you can do about it. If Script Merger messes with the mission text even more, it makes it even worse in most cases.

Sure, there might not be much I can do about it, but that won't stop me from trying!

Script Merger v2a now has a showMissionMode, which includes a mode that allows cycling through any script's mission text, including one that lists Goals, and if ShowMission is called outside of onGameStart, then it will only replace it's own, and have no effect on the others.

francot514
User offline. Last seen 2 years 7 weeks ago. Offline
Joined: 2015-03-20
Posts: 163

I do like the Evil Weapons idea, and will be cool to have it randomized for all shootable weapons, but you must check script there is error at line 96.

Mass Weapons should have extra weapons, but also is getting error at line 107.

doomy
doomy's picture
User offline. Last seen 3 days 10 hours ago. Offline
Joined: 2011-01-16
Posts: 132

francot514 allegedly wrote:

I do like the Evil Weapons idea, and will be cool to have it randomized for all shootable weapons, but you must check script there is error at line 96.

Mass Weapons should have extra weapons, but also is getting error at line 107.

Both of those errors seem to be due to you not having DoomyUtils installed. If you do have it installed, make sure you have it under Data/Scripts instead of Data/Scripts/Multiplayer.

Also, when mentioning an error, it helps to have more information than the line the error occurred on.

francot514
User offline. Last seen 2 years 7 weeks ago. Offline
Joined: 2015-03-20
Posts: 163

doomy allegedly wrote:

Both of those errors seem to be due to you not having DoomyUtils installed. If you do have it installed, make sure you have it under Data/Scripts instead of Data/Scripts/Multiplayer.

Also, when mentioning an error, it helps to have more information than the line the error occurred on.

Yes, nevermind, it was my mistake. Still it feels like more weapons are needed to be changed affected in booth gamemodes, can you expand for almost all shootables?

doomy
doomy's picture
User offline. Last seen 3 days 10 hours ago. Offline
Joined: 2011-01-16
Posts: 132

francot514 allegedly wrote:

Yes, nevermind, it was my mistake. Still it feels like more weapons are needed to be changed affected in booth gamemodes, can you expand for almost all shootables?

Evil Weapons: Most weapons that wouldn't screw up upon being replaced are used.

Mass Destruction: No, I think the eight destructive weapons are enough. Also, I am almost complete with the remaining modes I wanted to add to Mass Destruction.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]