I'd like to use custom explosions but can't figure out a way to do so. I guess in a way A_SpawnItemEx could work, but I'm not sure what the position parameters should be, because the BossBrain actos is positioned at different angles in different versions of Icon of Sin (e.g. in Doom 2 it's facing 90 degrees away from the face wall, while in Plutonia they're facing the same direction, and in Evilution it's again 90 degrees, but in different direction).
Any advice would be appreciated.
Modify A_BrainExplode/A_BrainScream?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Global Moderator
- Posts: 1117
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
-
- Posts: 2274
- Joined: Tue Jun 30, 2009 1:31 pm
Re: Modify A_BrainExplode/A_BrainScream?
The only way I could think would be to replace the BossBrain and its functions using ZScript. You could rewrite your own A_BrainScream, BrainishExplosion and A_BrainExplode - take a look at gzdoom.pk3's zscript/doom/bossbrain.txt
-
- Global Moderator
- Posts: 1117
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
Re: Modify A_BrainExplode/A_BrainScream?
I assumed so, but frankly I can't figure out what to change there. Zscript is still too confusing for me.Mikk- wrote:The only way I could think would be to replace the BossBrain and its functions using ZScript. You could rewrite your own A_BrainScream, BrainishExplosion and A_BrainExplode - take a look at gzdoom.pk3's zscript/doom/bossbrain.txt
-
- Posts: 1606
- Joined: Mon Jun 12, 2017 12:57 am
Re: Modify A_BrainExplode/A_BrainScream?
Functions cant be replaced. Only way, change it in gzdoom.pk3Mikk- wrote:replace the BossBrain and its functions using ZScript
-
- Global Moderator
- Posts: 1117
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
Re: Modify A_BrainExplode/A_BrainScream?
Um, surely I can (could, if I knew the script better) write my own version of the function, then replace BossBrain and make it use that new function?Apeirogon wrote:Functions cant be replaced. Only way, change it in gzdoom.pk3Mikk- wrote:replace the BossBrain and its functions using ZScript
Code: Select all
private static void BrainishExplosion(vector3 pos)
{
Actor boom = Actor.Spawn("Rocket", pos, NO_REPLACE);
if (boom)
{
boom.DeathSound = "misc/brainexplode";
boom.Vel.z = random[BrainScream](0, 255)/128.;
boom.SetStateLabel ("Brainexplode");
boom.bRocketTrail = false;
boom.SetDamage(0); // disables collision detection which is not wanted here
boom.tics -= random[BrainScream](0, 7);
if (boom.tics < 1) boom.tics = 1;
}
}
-
- Posts: 5038
- Joined: Sun Nov 14, 2010 12:59 am
Re: Modify A_BrainExplode/A_BrainScream?
boom is a pointer to the rocket which was spawned by the function. This pointer gives you access to that rocket actor to do whatever you want with it, like changing its variables, making it call functions on itself, and so on.Jekyll Grim Payne wrote:or what does "boom" mean here
-
- Global Moderator
- Posts: 1117
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
Re: Modify A_BrainExplode/A_BrainScream?
So, how can I replace just this part of A_BrainExplode so that it spawns a different object?Blue Shadow wrote:boom is a pointer to the rocket which was spawned by the function. This pointer gives you access to that rocket actor to do whatever you want with it, like changing its variables, making it call functions on itself, and so on.Jekyll Grim Payne wrote:or what does "boom" mean here
-
- Posts: 1606
- Joined: Mon Jun 12, 2017 12:57 am
Re: Modify A_BrainExplode/A_BrainScream?
"Boom" is means "spawn original doom rocket, which cant be replaced like 'new rocket:rocket replace rocket' ".
"boom.%_something_%" means "rocket part of a code with name %_something_%"
Like
Means "rocket death sound eqaul, change to, misc/brainexplode, sound what you hear when romero head leave this better of the worlds"
means "disable rocket trail for this rocket, more preciesly remove rockettreail flag"
Other lines means same as write after dot. Experiment with that, but if you want replace something provide something for replacing, since when engine reading zscript code and if they dong found thing for replace, it count it as critical error and refuses load furter.
"boom.%_something_%" means "rocket part of a code with name %_something_%"
Like
Code: Select all
boom.DeathSound = "misc/brainexplode";
Code: Select all
boom.bRocketTrail = false;
Other lines means same as write after dot. Experiment with that, but if you want replace something provide something for replacing, since when engine reading zscript code and if they dong found thing for replace, it count it as critical error and refuses load furter.