changing your starting weapon with DECORATE
Moderator: Graf Zahl
-
- Posts: 39
- Joined: Sun Oct 02, 2005 12:24
changing your starting weapon with DECORATE
Is it possable to change the weapons you start with to something other then fists and pistol?
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
-
- Posts: 39
- Joined: Sun Oct 02, 2005 12:24
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
That is something that will eventually be done once DECORATE is properly integrated into ZDoom. But what's the point?
Since I support FraggleScript and added support for one global script lump you can use that instead. Here's an example:
Just use it as FSGLOBAL lump. Quick explanation:
It takes away the default weapons from player 0 and gives new ones. The QuestItem is there so that this isn't executed repeatedly for the same player. It doesn't work for multiplayer though.
Since I support FraggleScript and added support for one global script lump you can use that instead. Here's an example:
Code: Select all
[scripts]
script 1
{
if (!checkinventory(0, "QuestItem1",1))
{
takeinventory(0, "Pistol");
takeinventory(0, "Clip", 999);
giveinventory(0, "DHPulse");
setweapon(0, "DHPulse");
giveinventory(0, "QuestItem1");
}
}
startscript(1);
It takes away the default weapons from player 0 and gives new ones. The QuestItem is there so that this isn't executed repeatedly for the same player. It doesn't work for multiplayer though.
-
- Posts: 39
- Joined: Sun Oct 02, 2005 12:24
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Somewhere on the Legacy homepage there might be a reference. But the code above is GZDoom exclusive. I added some functions to FraggleScript to handle ZDoom's inventory system better. The original implementation only knew about the original weapons, ammo types and keys and the handling was rather limited.
- Soultaker
- Posts: 219
- Joined: Fri Sep 02, 2005 8:26
- Location: Capping some zombies Gangsta Style.
- Contact:
Also Graf failed to mention probably cause he does not know BUT most wads like Sci2 and Rebirth will screwup the fragglescript and give you the old starter weapons. When that happens just use the give command in the console if you want your new starter weapons in your hands. I think something in the Dehack and DeuTex files that some of the wads have screws up Fragglescript. It is a one time screwup thankfuly. What that mneans is that on the next map you will have the new starter weapons THAT is if you did use the give command. Oddly enough it is just those two wads I have mentioned that muck up Fragglescript. O_o I think more testing is needed though to try and fix this little annoyance.
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
- Soultaker
- Posts: 219
- Joined: Fri Sep 02, 2005 8:26
- Location: Capping some zombies Gangsta Style.
- Contact:
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:

I wish I'd know about that Fraggle Script way of doing things a few days ago. I just went through a bunch of levels laboriously scripting the startup weapons. That FSGlobal idea works brilliantly.
Is "QuestItem" some sort of internal known about name, or could I use anything? (Hmm, thinks... it's a Strife thing isn't it?)
An additional question (sort of related). Is there any way to set "PROP_INSTANTWEAPONSWITCH" without an ACS script? A cant see a CVAR or option for it.
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Yes, it's from Strife. But since it isn't used in Doom and already defined I just used it.Enjay wrote: Is "QuestItem" some sort of internal known about name, or could I use anything? (Hmm, thinks... it's a Strife thing isn't it?)
Either ACS or a line special. There are no other means to set it. You can use it from FraggleScript as well but the PROP_ constants are not defined.An additional question (sort of related). Is there any way to set "PROP_INSTANTWEAPONSWITCH" without an ACS script? A cant see a CVAR or option for it.
For FS you use
Code: Select all
ls(setplayerproperty, arg1, arg2, arg3);
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
OK, I'm afraid you've lost me there. lspec.h - is that a file? I've looked in the GZDoom and Legacy source and cannot find a file of that name. Never the less, I added an include line to my script.Graf Zahl wrote:For FS you use
but you have to include 'lspec.h'Code: Select all
ls(setplayerproperty, arg1, arg2, arg3);
I looked at the FS reference that I could find via the Legacy site and couldn't find anything to do with setting player properties.
I tried this:
Code: Select all
[scripts]
include("lspec.h");
script 1
{
ls(setplayerproperty, 1, 1, 2);
blah
blah
blah
So I tried using the Zdoom special number.
Code: Select all
[scripts]
include("lspec.h");
script 1
{
ls(191, 1, 1, 2);
blah
blah
blah
Anyway, having now seen again what instant weapon switching is like, I don't really like it that much anyway. Quickweaponswitch would be a more aesthically pleasing option to me.
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
OK, thanks, it's working now. The correct case allowed it to understand "SetPlayerProperty". On its own, as the only line in the script it worked. However, combining it with my other stuff, it didn't work. Using a "wait" statement (which seems to be correct, rather than delay), and putting the line after the "if" stuff did work, however. For info, here's the whole thing.
Code: Select all
[scripts]
include("lspec.h");
script 1
{
if (!checkinventory(0, "QuestItem1",1))
{
giveinventory(0, "NJFist");
takeinventory(0, "Pistol");
takeinventory(0, "Fist");
takeinventory(0, "Clip", 999);
giveinventory(0, "FlashLight");
giveinventory(0, "NJDaystick");
giveinventory(0, "NJBoot");
giveinventory(0, "MWeapWand");
giveinventory(0, "NJStracherPistol2");
giveinventory(0, "NJStracherPistol");
setweapon(0, "NJStracherPistol");
giveinventory(0, "QuestItem1");
}
wait(35);
ls(SetPlayerProperty, 1, 1, 2);
}
startscript(1);
- Soultaker
- Posts: 219
- Joined: Fri Sep 02, 2005 8:26
- Location: Capping some zombies Gangsta Style.
- Contact:
The following is how I have it set for my mod. Note though the game reverts to the starter weapon every time a new map is loaded. I find it to be highly annoying.
Code: Select all
[scripts]
script 1
{
if (!checkinventory(0, "st-dlss",1))
{
takeinventory(0, "Pistol");
takeinventory(0, "Fist");
giveinventory(0, "Glock");
giveinventory(0, "PunchKickCombo");
takeinventory(0, "Clip", 50);
setweapon(0, "Glock");
}
}
startscript(1);