(SOLVED)Powerup that spawns something as it lasts?
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
(SOLVED)Powerup that spawns something as it lasts?
I'm wondering if it's possible to make a powerup that spawns something (like a spam of projectiles or an explosion) every X tics while it lasts?
Last edited by FranckyFox2468 on Mon Nov 14, 2016 6:44 pm, edited 2 times in total.
Re: (DECORATE)Powerup that spawns something as it lasts?
Use an ACS script.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
Re: (DECORATE)Powerup that spawns something as it lasts?
An exemple would be nice if possible. That is a well done one, unless its as basic as an inventory check so it spawns something. But wouldn't even know how to do so at a player's position.
- ZZYZX
- Posts a lot
- Posts: 742
- Joined: Thu Jun 07, 2012 5:56 pm
- Location: Ukraine
- Clan: A3
- Clan Tag: [A3]
Re: (DECORATE)Powerup that spawns something as it lasts?
Subclass this in decorate http://zdoom.org/wiki/Classes:CustomInventory
Then make an ACS library http://zdoom.org/wiki/Libraries
In the ACS library, create a script like this one (this script starts and executes some code every second for 10 seconds):
Then put an ACS_ExecuteWithResult(666) in your CustomInventory thing in Pickup: state (if the powerup is used instantly) or Use: state (if it's stored in the inventory).
Player position can be received with GetActor# family of functions.
Spawning is done by the Spawn family (see the bottom of this page for other spawn-related functions).
Then make an ACS library http://zdoom.org/wiki/Libraries
In the ACS library, create a script like this one (this script starts and executes some code every second for 10 seconds):
Code: Select all
script 666 (void)
{
for (int i = 0; i < 10; i++)
{
// spawn something here.
Delay(35);
}
}
Player position can be received with GetActor# family of functions.
Spawning is done by the Spawn family (see the bottom of this page for other spawn-related functions).
Last edited by ZZYZX on Sun Nov 13, 2016 1:52 am, edited 1 time in total.
quality DoomExplorer hackeringFilystyn wrote:Do you know what windows.h is? It's D, DWORD.
overcomplicated ZDoom grenade
random Doom things
GZDoomBuilder-Bugfix
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
Re: (DECORATE)Powerup that spawns something as it lasts?
Neat, ill try it out whenever i can!
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
Re: (DECORATE)Powerup that spawns something as it lasts?
Uh, i would like to ask another question, if the spawn is done via a script and not via a decorate or an actor itself, wouldn't it result the projectile to hurt the user of the projectile as well and its allies?
EDIT: I tried a work around in the meantime of an inventory item that loops its effect for as long as the powerup is detected on the player but i seem to be running out of luck... Only does it once you pick up the item then it stops
EDIT: I tried a work around in the meantime of an inventory item that loops its effect for as long as the powerup is detected on the player but i seem to be running out of luck... Only does it once you pick up the item then it stops
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
Re: (DECORATE)Powerup that spawns something as it lasts?
Don't know if i'm doing this right but nothing seems to be spawning:ZZYZX wrote:Subclass this in decorate http://zdoom.org/wiki/Classes:CustomInventory
Then make an ACS library http://zdoom.org/wiki/Libraries
In the ACS library, create a script like this one (this script starts and executes some code every second for 10 seconds):Then put an ACS_ExecuteWithResult(666) in your CustomInventory thing in Pickup: state (if the powerup is used instantly) or Use: state (if it's stored in the inventory).Code: Select all
script 666 (void) { for (int i = 0; i < 10; i++) { // spawn something here. Delay(35); } }
Player position can be received with GetActor# family of functions.
Spawning is done by the Spawn family (see the bottom of this page for other spawn-related functions).
Code: Select all
script 600 (void)
{
for (int i = 0; i < 30; i++)
{
str class = "StarmanAOE";
do {
delay(1);
int x = GetActorX(0);
int y = GetActorY(0);
int z = GetActorZ(0);
int angle = GetActorAngle(0);
} until (Spawn(class, x, y, z, 0, angle));
Delay(1);
}
}
EDIT: Figured its because i forgot to put #include "zcommon.acs", tho what is weird is that instead of counting seconds it counts ticks, like it only lasts 10-30 tics. And it also hurts allied players as i feared.
EDIT2: I figured a work around using ZZYZX's script (Will remember to give him a special thanks if this project gets finished), instead of spawning something every X tics, it gives an item to the player that spawns something every X tics. So it doesn't affect the player and nor allied players :D. Thanks for the help guys!