Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
FanTazTiCxD

How do I reset to defailit inventory when entering next level?

Recommended Posts

Hi, long time no see! Really long time, I bet none of you remember me... I'm currently trying to make a wad with several levels. I want the player to start the third level (MAP03) with the default inventory (50 rounds of pistol and fist) and NOT keep the weapons and ammo picked up from the previous level. How do I do that? Is there an option-menu in-game where I can disable this, or can I use some kind of a trick in doom builder to make sure the player starts with no weapons apart from the default pistol?

I've tried ending the previous level with "sector damage 10-20% and end level", and make MAP03 start in a poisionous sector, to make sure you'd die from the start, and had to respawn, but even when dying, it seems that zdoom loads the save, instead of simply making you respawn WITHOUT all your weapons like in the classic doom...

Does anyone have a solution to this?

Share this post


Link to post

You could try a Scythe-map10-style death exit in the prior level. If ZDoom only, I imagine resethealth and resetinventory mapinfo keywords could also suffice.

Share this post


Link to post

Assuming it's for ZDoom, write the following ACS:

#library "CLEARINV"
#include "zcommon.acs"

//enforce pistol start
script 900 ENTER{
        ClearInventory();
        GiveInventory("Fist", 1);
        GiveInventory("Pistol", 1);
        TakeInventory("Clip", 999);
        GiveInventory("Clip", 50);
        SetWeapon("Pistol");
        SetActorProperty(0, APROP_HEALTH, 100);
}
compile it into a lump and make sure it's between A_START and A_END markers. Then add a LOADACS lump http://zdoom.org/wiki/LOADACS with a line that says "CLEARINV"

Share this post


Link to post

If it's ZDoom, use this script :

#include "zcommon.acs"
Script 1 enter
{
clearinventory ();
healthing (100); //If you want health to be reset too
giveinventory ("pistol", 1);
}

Share this post


Link to post

I'm sorry for being a complete noob about this, but how exactly am I going to do this? I have this now:

#library "CLEARINV"
#include "zcommon.acs"

//enforce pistol start
script 900 ENTER{
ClearInventory();
GiveInventory("Fist", 1);
GiveInventory("Pistol", 1);
TakeInventory("Clip", 999);
GiveInventory("Clip", 50);
SetWeapon("Pistol");
SetActorProperty(0, APROP_HEALTH, 100);
}


But I don't know what to do with it. Do I have to insert it into a text-file somewhere? I don't even know what a lump is. I think I need a userfriendsly beginners explanation to how I am going to do this :P I've been to youtube, and I found this video:

https://www.youtube.com/watch?v=Q7AgiEP0vCA

So I tried compiling this script in the script editor, but then it came up with this:

ERROR: Fatal error -2147221502 while compiling ACS: Could not run script compiler!

I have an idea that I misunderstood something big-time...

Share this post


Link to post

The problem here is that I am using Doom Builder 1, since that is the version I have always been using, so I am kind of used to this version. Is it possible to do this with DB1?

What I do is, that I am go to the "Scripts" tab
open "Edit BEHAVIOR lump"
Type in the codes
And press compile, when the error appears. I might just figure out another solution than having to start without your weapons, if I can't make this work

Edit: For some reason it works now. The first three maps uses doom2 engine, and the fourth one that I was asking about uses hexen format. It works for me now :-)

Share this post


Link to post
Mithran Denizen said:

You could try a Scythe-map10-style death exit in the prior level. If ZDoom only, I imagine resethealth and resetinventory mapinfo keywords could also suffice.


As Mithran said, use that trick (also used in Eternal MAP13), you don't need any scripting and it will work on Vanilla ports as well.

The trick is to kill both the player and an Icon of sin at the same time. To do so you can create a hidden closet with both an Icon of Sin and a Voodoo Doll close to each others. You surround them with several barrels and force the player to trigger a crusher in the closet.

EDIT: I posted this message before you edited your last message. Cool if it works, but this other trick still has a better cross-port compatibility. ;)

Share this post


Link to post

I don't know where you got Doombuilder 1.68 from, chances are though, that it has not been changed from the time
you used it last. The thing about scripting is that the support for it evolves with time, and thusly may be out of date.

To make sure, run cmd and drag acc.exe onto it and append with -h and run it

Spoiler

If you do not have version 1.54, then it is time to update:
    Go to http://zdoom.org/Download and download ACC 1.54, unzip and replace the old files.
    Go to https://github.com/rheit/acc .
    See the last three files zdefs.acs, zspecial.acs and zwvars.acs.
    Verify that their contents is the same as the downloaded files.
    If not, then copy/paste the raw contents into the downloaded files,
    replacing the old text.
Then try compiling the script again.
If you still have errors, then upload what you typed and have someone check it.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×