A Christmas present for ZDoom
Moderator: GZDoom Developers
- Your Name Is
- Posts: 802
- Joined: Sun Oct 31, 2004 5:06 pm
- Location: Raleigh, NC
- Contact:
- Killo Zapit
- Posts: 292
- Joined: Wed Jul 16, 2003 9:26 pm
- Location: Most likely sleeping.
I still have need of something like this for destroyable items:
Out of curiosity, if I wanted to make my own exe, how would I add it to the codepointer list? Do I just stick "FUNC(A_UnSetSpecial, NULL)" somewhere in the "AFuncDesc AFTable[]=" block?
Also, would it someday be possible to set an item's use function to run a codepointer and/or action special like a state? I think it can be done. Maybe I should try and do it myself. I am not exactly a coder though. Let's see if I got the steps right: 1. Put "{ "inventory.useaction", (apf)InventoryUseAction, RUNTIME_CLASS(AInventory) }," somwhere in the "ActorProps props[] =" block. 2. Create a static "static void InventoryUseAction (Inventory *defaults, Baggage &bag)" function which does the following: SC_MustGetString(), Split the sting into the codepointer/action special name and any parameters, look up the codepointer/action special, store the codepointer/action special somewhere, and set's the item's "Use" function to some other function. 3. Make the inventory use function which will recall all the data stored in InventoryUseAction, and run the codepointer/action special as if the player had. I am not entirely sure how to do all of that. Is there an easier way?
Then again, I would have to convert all the project files ZDoom uses anyway because my copy of Visual C++ is out of date if I wanted to compile anything anyway...
Code: Select all
void A_UnSetSpecial (AActor *self)
{
self->flags &= ~MF_SPECIAL;
}Also, would it someday be possible to set an item's use function to run a codepointer and/or action special like a state? I think it can be done. Maybe I should try and do it myself. I am not exactly a coder though. Let's see if I got the steps right: 1. Put "{ "inventory.useaction", (apf)InventoryUseAction, RUNTIME_CLASS(AInventory) }," somwhere in the "ActorProps props[] =" block. 2. Create a static "static void InventoryUseAction (Inventory *defaults, Baggage &bag)" function which does the following: SC_MustGetString(), Split the sting into the codepointer/action special name and any parameters, look up the codepointer/action special, store the codepointer/action special somewhere, and set's the item's "Use" function to some other function. 3. Make the inventory use function which will recall all the data stored in InventoryUseAction, and run the codepointer/action special as if the player had. I am not entirely sure how to do all of that. Is there an easier way?
Then again, I would have to convert all the project files ZDoom uses anyway because my copy of Visual C++ is out of date if I wanted to compile anything anyway...
If it hasn't changed since around the time when thingdef was new, then yes that is all you need to do basically.Killo Zapit wrote: Out of curiosity, if I wanted to make my own exe, how would I add it to the codepointer list? Do I just stick "FUNC(A_UnSetSpecial, NULL)" somewhere in the "AFuncDesc AFTable[]=" block?
Also, check the wiki for info on how to convert the project files and upgrade VS .net
http://forum.zdoom.org/viewtopic.php?p= ... test#83691Your Name Is wrote:LFIjdsafdnldsjflsndf
Bleh yeah!
I will wait patiently for .97 to come out, so Wiki can help meh.
- deathz0r
- Posts: 353
- Joined: Tue Jul 15, 2003 4:09 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Land with them kangaroo
- Contact:
Another thing I've noticed is that Weapon.AmmoGive does not appear to work (correctly). I haven't extensively tested where the problem originates, but every single DECORATE weapon only gives 2 ammo when picked up. Now, I have the weapons ordered as so:
I'll try experimenting with the first and last weapons and see which one affects all of the other weapons.
EDIT: It's the last weapon that affects all the others.
Code: Select all
ACTOR IceGrenadeLauncher : Weapon 20018
{
Weapon.AmmoGive 2
}
ACTOR IceLauncherPowered : IceGrenadeLauncher
{
+POWERED_UP
Weapon.AmmoGive 0
}
ACTOR Railgun : Weapon 20020
{
Weapon.AmmoGive 10
}
ACTOR AutoRailgun : Railgun
{
+POWERED_UP
Weapon.AmmoGive 0
}
ACTOR SekreetWeapon : Weapon 20019
{
Weapon.AmmoGive 10
}
ACTOR SuperSekreetWeapon : SekreetWeapon
{
+POWERED_UP
Weapon.AmmoGive 0
}
ACTOR BombLauncher : Weapon 20000
{
Weapon.AmmoGive 2
}
ACTOR SuparMiniMissileLauncher : Weapon 20001
{
Weapon.AmmoGive 2
}
ACTOR SuperSuparMiniMissileLauncher : SuparMiniMissileLauncher
{
+POWERED_UP
Weapon.AmmoGive 0
}
ACTOR SekreetWeapon2 : Weapon 20021
{
Weapon.AmmoGive 2
}EDIT: It's the last weapon that affects all the others.
- Your Name Is
- Posts: 802
- Joined: Sun Oct 31, 2004 5:06 pm
- Location: Raleigh, NC
- Contact:
Zdoom won't run it.Chilvence wrote:http://forum.zdoom.org/viewtopic.php?p= ... test#83691Your Name Is wrote:LFIjdsafdnldsjflsndf
Bleh yeah!
I will wait patiently for .97 to come out, so Wiki can help meh.
Well, that, and I believe there was a problem with the ammo since it wasn't defined (I think that was the problem... I never actually ran that test file, and have yet to start making ammo-using weapons for my own project). Simply change the ammo type in Graf's example to something already defined ("Clip"), and I don't think there's any reason why it wouldn't work.
- deathz0r
- Posts: 353
- Joined: Tue Jul 15, 2003 4:09 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Land with them kangaroo
- Contact:
They are already defined as existing ammo types, I just only put in all the extremely relevant information.Finalizer wrote:Well, that, and I believe there was a problem with the ammo since it wasn't defined (I think that was the problem... I never actually ran that test file, and have yet to start making ammo-using weapons for my own project). Simply change the ammo type in Graf's example to something already defined ("Clip"), and I don't think there's any reason why it wouldn't work.
- deathz0r
- Posts: 353
- Joined: Tue Jul 15, 2003 4:09 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Land with them kangaroo
- Contact:
New undocumented (because Graf is EVEEL) weapon stuff for you people who are using this version:
A_FireBullets(h-spread,v-spread,pellets,damage,(unused?),ammo)
A_RailAttack(damage,x-offset,ammo)
A_FireBullets(h-spread,v-spread,pellets,damage,(unused?),ammo)
A_RailAttack(damage,x-offset,ammo)
AttackSound works with A_FireBullets.Anakin S. wrote:Is it just me or does the weapon AttackSound not work?
- Anakin S.
- Posts: 1067
- Joined: Fri Nov 28, 2003 9:39 pm
- Location: A long time ago in a galaxy far, far away...
Would it be possible to add an angle parameter to A_SpawnItem? With that we could emulate the firestorm circle of flames and the pain elemental's death.

Oh. So that's why it didn't work for me. I was only spawning missiles. Thanks.deathz0r wrote:AttackSound works with A_FireBullets.Anakin S. wrote:Is it just me or does the weapon AttackSound not work?
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Sure. But it still won't thrust the object so you wouldn't be able to emulate the Pain Elemental with it unless you make the change in the spawned monster.Anakin S. wrote:Would it be possible to add an angle parameter to A_SpawnItem? With that we could emulate the firestorm circle of flames and the pain elemental's death.
Oh. So that's why it didn't work for me. I was only spawning missiles. Thanks.deathz0r wrote:AttackSound works with A_FireBullets.Anakin S. wrote:Is it just me or does the weapon AttackSound not work?
A Question: How difficult would it be to add another variable for scaling the on-screen view of the weapon? It seems odd that this is available for all other sprites in DECORATE, but not the weapons...
And yes, I know, I know "code it yourself, blah, blah..." If I could get .96 to compile, I would try... the last version I could compile was .63a.
And yes, I know, I know "code it yourself, blah, blah..." If I could get .96 to compile, I would try... the last version I could compile was .63a.