Serious Sam Fusion 2017 (beta)

Serious Sam Fusion 2017 (beta)

Mystery Box [Resource]
 This topic has been pinned, so it's probably important
Mauritsio  [developer] 11 Feb, 2018 @ 12:25pm
Setup Guide for mappers
This is a guide for mappers on how to set up the Mystery Box to their specifics likings.
It assumes the reader possesses atleast a basic grasp of how to use the Serious Editor, and programming/scripting in general.


Putting the Box into your world
Open up the EntityList and put an AmmoRefill entity into your world. If you're using the tabbed EntityList, it's under the Tools tab. Now under the Item Params, navigate to: "Content/SeriousSam3/Databases/Items/MysteryBox/MysteryBox.ep", and double-click it. If you don't wish to use a custom weapon pool, then this is all you need to do. The game will now use default weapons in the Mystery BOX (BFE weapons in BFE level, HD weapons in HD level...) Otherwise, read the next section.

Modifying the Box with custom weapons
Open the EntityList again, and insert a Script into your world - under the Logic tab, as you surely know. Press E with the Script selected, and now copy this script into the newly opened editing window:
Wait(CustomEvent("OnStep")) table.insert(worldGlobals.MysBoxWeaponTables, { thisMysteryBox, {"Chainsaw", "TommyGun", "MiniGun", "Laser", "Flamer"}, false, 30 })
DO NOT, and I repeat, DO NOT change anything in this script other than what you are instructed to do! The Box simply won't work otherwise, so be cautious!

Let's go over this now. The first step is to assign the Mystery Box you want to edit. Drag and drop your Mystery Box entity onto the "thisMysteryBox" value. Do so by clicking the box, holding down Ctrl+Alt+Shift, then while continously holding those keys down, drag the entity onto the "thisMysteryBox" words. If the words turn blue, and marked green if you have the box selected, great, you have the first step down!

Second step is to specify which weapons will be put in the Box. Some example weapons have already been set up, as you can see - you can edit them and add new ones to your heart's content - there is no limit on the amount of weapons you may use. Just make sure to seperate them by comma's and put them in quotations marks, and don't touch the curly brackets. The string values themselves are dictated by NSKuber's Weapon Resource Database. To find out what string to use, look it up in this pastebin link: https://pastebin.com/6nY2aP2U. For example, if I wanted to use noam 2000's Tau Cannon in my weapon pool, I use Ctrl+F and look for "Tau Cannon". I see this line in the pastebin:
["TauCannon"]="Tau Cannon (by noam 2000)",
. So I write "TauCannon" into the array on the second line. These identifiers aren't always as self-explanatory, so always check the pastebin! Continue doing this until all the weapons you want are within the curly brackets.

Third step is changing the boolean. It specifies whether the player will recieve their weapons from the Mystery Box with full ammo or not. If you set it to "false", it will give the player the same ammount of ammo they would recieve if they pick up the weapon normally. But if set to "true", the player will get the weapon with as much ammo as the weapon permits.

The last step is to modify the number. This number defines how long the mystery box will be inactive before it can be opened another time after usage. This number is in seconds. If you wish for there to be no wait time (one-time usage), set this number to 0.

Of course, this entire process can be repeated for multiple mystery boxes! Just re-insert the script code mentioned above at another place in the script and repeat the steps.

Common issues and known problems
The first thing to look for if you have any kind of problem, is if you have all the needed requirements for the mod. These are:
Also, you need to own atleast Serious Sam 3: BFE on Steam. Obviously.
If you are absoultely sure you have these mods subscribed and enabled (check "Extras -> Workshop Packages" in the main menu, and see if the mods are actually enabled), then you can check specific questions.

Question: "I get an 'Unable to load level' error when I load up my map, and I'm sure the Mystery Box is causing it!"
Answer: You likely put a custom weapon into the array that you aren't subscribed to. Check over the array carefully and see if you aren't missing any weapons on your end.

Question: "My script returns an error!"
Answer: Perhaps you made a mistake while creating the custom Mystery Box script. Check if all the variable types are correct (example: you put a string value at the recharge time number, for whatever reason), the mystery box entity is correctly assigned and there are no syntax errors (red lines) in the script itself. If this does not fix your problem - report the script error in the comments, post your custom Mystery Box script aswell, and I will identify the issue (and fix the mod if necessary) at my earliest convenience.

Question: "A certain weapon I put into the weapons array isn't showing up in-game!"
Answer: There are two causes for this. The first is that the weapon can't be found in the Weapon Resource Database - so it hasn't been implemented yet, or you misspelled the weapon identifier. Double check this. But the most likely cause is that the weapon does not possess a BFE variant. The reason the weapon requires a BFE variant is to correctly be shown in the box's weapon cycle - if I were to use HD weapons here, the weapon would show oversized in the cycle and out of place. And as of right now, there is no way to change the weapon size. No, I will not remove this limitation. Every weapon simply needs a BFE variant, period. Contact the weapon's creator about this problem - it's not my issue, and I will ignore your query if you ask me about this.

Question: "My Mystery Box has a colored crosshair if I'm aiming at it. Is this normal?"
Answer: Yes. Long story short, the mystery box used the same entity type uses for monsters as its base since they are the most convenient for network syncing. Don't worry, the Mystery Box can't actually "die". You can try, but you'll just waste your ammo! :)

Question: "It's not working!"
Answer: No. Be more descriptive than that. If this is all you'll tell me, I'm just gonna delete your comment.

Your problem is not listed here? Be as descriptive as possible in the comments and I'll investigate it - maybe I'll add you as well if I need more info, so check your invite inbox!
< >
Showing 1-2 of 2 comments
Morderclock 16 Mar, 2020 @ 7:22am 
In Content/SeriousSam3/Databases/Items I dont have the MysteryBox Folder but if i Paste Content/SeriousSam3/Databases/Items/MysteryBox/MysteryBox.ep Then it teleport me to Content/SeriousSam3/Databases/Items/MysteryBox HELP!
Mauritsio  [developer] 24 Mar, 2020 @ 1:39pm 
I'm so sorry for the late response!
I would check if the Mystery Box is actually enabled in your Fusion menu. Check under Extras -> Workshop Packages, and make sure the Mystery Box item is enabled.
< >
Showing 1-2 of 2 comments
Per page: 1530 50