No Splash Powerup Help! Causes crash for some reason

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.
Locked
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

No Splash Powerup Help! Causes crash for some reason

Post by Amuscaria »

I'm trying to make a powerup that stops the layer from taking slash damage and renders him immune to most damaging floors. I got the floor-protection working, but I cant seem to find the ACS equivilent to A_ChangeFlag. I was hoping to do something like this "A_ChangeFlag("NORADIUSDMG",1)" Does that work? Also, if I change the players flag, do the flags reset everytime he goes to a new stage or is it kept?
Last edited by Amuscaria on Thu Sep 14, 2006 9:08 pm, edited 1 time in total.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

Why not use GiveInventory() and give the player an item that will use A_ChangeFlag() and change him to be immune to radius damage?
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Theshooter7 wrote:Why not use GiveInventory() and give the player an item that will use A_ChangeFlag() and change him to be immune to radius damage?
I thought about that, but if I change a flag, do I need to change it back so he doesnt have it at the next map?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Well, you'd probably need a second simple item that removes the flag in the same manner, and give that at map start. It wouldn't be much more trouble than turning it on, though.

Also, if you don't feel like checking and removing at the beginning of each map, a cheap way would be to just use a global script library with something that looks like this:

Code: Select all

script 92939393 enter
{
      giveinventory("RadiusDamageEnabler",1);
}
Syntax hasn't been checked, and the script number is bogus, but it felt necessary. :P
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Theshooter7 wrote:Why not use GiveInventory() and give the player an item that will use A_ChangeFlag() and change him to be immune to radius damage?
Erm, something tells me that won't work. Wouldn't the A_ChangeFlag function change the flag of the item itself and not the player?

Also, seeing as how the item will be destroyed when the player picks it up, where would you put the command?
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

I know someone has gotten it to work before. When I first moved to Zdoom, i suggested that a NORADIUSDMG powerup.type be added, it was refused. But someone got it working through ACS. I forgot who though.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Hmmm, what you could do is use A_JumpIfInventory to jump to an A_ChangeFlag function within the player's states if they have the item in question.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Ok, something is wrong with my library. I made a *.o file just like i did for the regeneration, but for some reason it wont recognize my script when I run the game.

Here's my library:

#include "zcommon.acs"

bool Hellsphere[8];
Spoiler:
Whenever I pick it up, I get this 'ACS: I dont know what (a Flat name) is" or it jsut crashes out. Here's the crash report.

Here's the decorate:
Spoiler:
it;s supposed to give the NORADIUSDMG flag and a powerup that lasts for (2 hours, since i dont know how to set a powerup to last forever) that takes away floor and environment damage.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

HotWax wrote:Erm, something tells me that won't work. Wouldn't the A_ChangeFlag function change the flag of the item itself and not the player?
No, it will change the activator's (player's) flag.
User avatar
Anakin S.
Posts: 1067
Joined: Fri Nov 28, 2003 9:39 pm
Location: A long time ago in a galaxy far, far away...

Post by Anakin S. »

As long as it's in the item's Pickup/Use states.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Ok, I got the powerup working besides the script part. So there is something wrong with what I'm doing with the giveinventory actions. Can someone point how whats wrong? Cuz I get "ACS: I dont know what (then a name of a flat within the map) is."
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

I can't remember, but aren't you not allowed to have delays inside of while statements? I might be wrong on that though. Maybe I am mistaking it for functions...
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Theshooter7 wrote:I can't remember, but aren't you not allowed to have delays inside of while statements? I might be wrong on that though. Maybe I am mistaking it for functions...
The regeneration thing worked just fine with the delays. o_o I basically copy and pasted the thing and just added the giveinventory commands.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Grubber wrote:
HotWax wrote:Erm, something tells me that won't work. Wouldn't the A_ChangeFlag function change the flag of the item itself and not the player?
No, it will change the activator's (player's) flag.
Doh! Been gone... too long! Must.... research.... more!
Theshooter7 wrote:I can't remember, but aren't you not allowed to have delays inside of while statements? I might be wrong on that though. Maybe I am mistaking it for functions...
Yes you are. ACS doesn't support delays in functions because a function should occur entirely within 1 tic, unlike scripts which can span multiple tics using delays.

This does have the side-effect of making most while loops pointless in functions since whatever the while is waiting on is unlikely to change. Maybe that's where your confusion comes from.
Locked

Return to “Editing (Archive)”