Another Newbie Weapon Decorate Question

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Hellser
Global Moderator
Posts: 2787
Joined: Sun Jun 25, 2006 4:43 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Citadel Station

Another Newbie Weapon Decorate Question

Post by Hellser »

I have a pistol that I wish to replace the original one. I used this command (I'm using GZDooM, I don't know if ZDooM has this option but..)

Location: FSGLOBAL

Code: Select all

[scripts]

script 1
{
   if (!checkinventory(0, "QuestItem1",1))
   {
      takeinventory(0, "Pistol");
      giveinventory(0, "Pistol1");
      setweapon(0, "Pistol1");
      giveinventory(0, "QuestItem1");
   }
}
startscript(1);
Theres a glitch with this though, only Player 1 recieves it. During multiplayer test, Player 2 dosn't recieve it and goes on. Is there a way to fix this?
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

this would probably be better asked on the gzdoom forums... i dont have the link handy, sry :)
User avatar
Hellser
Global Moderator
Posts: 2787
Joined: Sun Jun 25, 2006 4:43 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Citadel Station

Post by Hellser »

chaoscentral wrote:this would probably be better asked on the gzdoom forums... i dont have the link handy, sry :)
Like I said I don't know if ZDooM uses Fragglescript or not so thought I'd ask here first since theres alot of scripters here.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

FSGlobal isn't good for multiplayer. Use Global ACS.
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

Blade Nightflame wrote:FSGlobal isn't good for multiplayer. Use Global ACS.
I've always wondered how to implement Global ACS... Any guides or anything... I'll have a look in the wiki to see if there's anything.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

chaoscentral wrote:
Blade Nightflame wrote:FSGlobal isn't good for multiplayer. Use Global ACS.
I've always wondered how to implement Global ACS... Any guides or anything... I'll have a look in the wiki to see if there's anything.
There have to be these lumps, in order:

Code: Select all

A_START
<compiledscriptname>
A_END
LOADACS
LOADACS should be type 0, and have only the name of the compiled script (like DUDESCR1, for example as a name) inside it.

The script should be compiled ofcourse, and you can leave an uncompiled script for people to see what's in the compiled one.
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

ok, so set it up like a standard library, and then have a LOADACS lump with the name of it inside? Sounds simple enough

Is there a way to have per map Global ACS? or will it run the scripts on every map,

like lets say I wanted the weapons changed at the start of map01, but not at map02... Would I just have to write a script to check which map it is, and execute the certain code, or what...

Sorry if this is a bit annoying, but you can never know too much...
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

chaoscentral wrote:ok, so set it up like a standard library, and then have a LOADACS lump with the name of it inside? Sounds simple enough

Is there a way to have per map Global ACS? or will it run the scripts on every map,

like lets say I wanted the weapons changed at the start of map01, but not at map02... Would I just have to write a script to check which map it is, and execute the certain code, or what...

Sorry if this is a bit annoying, but you can never know too much...
if (mapnum == 01)

Should seem like what you're looking for. :P
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

gotcha... hmmmm too bad you couldnt define which acs file to load for which map....(maybe a feature request)

Thank you very much, this should be useful in my currently un named project
User avatar
AFADoomer
Posts: 1344
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Post by AFADoomer »

If you want to do that, you may as well just put the ACS in the SCRIPTS lump and compile it like a normal script...
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

AFADoomer wrote:If you want to do that, you may as well just put the ACS in the SCRIPTS lump and compile it like a normal script...
If that was directed at me, that wouldnt work, I'm thinking in two different instances here, like for instance.

A weapon mod, you want the pistol to be replaced on map01, so you have it clear the inventory and add your new pistol and fist. well, if its in the global ACS, then itll do that at the beginning of every map. not exactly going to help you when you start off every level with a pistol type weapon and nothing more. Even just removing the old pistol and adding a new one, you will remove it more than once and add a new pistol every map. I'm sure there is a way around it, but it would make it much easier if you could possibly specify which map can load a global ACS lump.

I wasn't talking for my un named mod. For that I will probably use Libraries for re usable scripts... I'm not worried about that
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

Actually Chaoscentral, Global ACS doesn't repeat after every map. It works per-wad, so to say. Trust me.
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

Well, after a little test, it does indeed repeat the entire ACS file after each map. I set it to print text on the screen, and it does after each map. Its the only thing in the WAD, and I'm running it with Doom2.wad... So now I just need to find out which map its on, and have it do a specific function.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

chaoscentral wrote:Well, after a little test, it does indeed repeat the entire ACS file after each map. I set it to print text on the screen, and it does after each map. Its the only thing in the WAD, and I'm running it with Doom2.wad... So now I just need to find out which map its on, and have it do a specific function.
If it doesn't with weapon mods..

EDIT: Well god damn. I was only testing MAP01 all the time. It does change. Maybe I'll try the if statement. :?

How the HELL did Xaser get to compile these kind of things anyway? The if (mapnum==1); thing doesn't work, and neither does a certain mission objects script, yet, it's compiled all in his wad. Huh.. :(
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

Well, The way I somewhat got it to work, was create a dummy item, and check if the player has it... if they dont(which they shouldn't) it would execute the script, and if they did have it, it would exit the script... thats one way of doing it
Locked

Return to “Editing (Archive)”