Add translation parameter to all spawning functions
Moderator: GZDoom Developers
Add translation parameter to all spawning functions
Including the ACS spawn and projectile functions, and the custommissile codepointers in DECORATE, etc.
If not for completeness' sake.
If not for completeness' sake.
- Theshooter7
- Posts: 456
- Joined: Sun Mar 05, 2006 6:44 pm
I'd particularly appreciate the translation parameter for A_CustomMissile for some of the effects I'd like to use in my wad.
Regarding the TID of 0 uses activator - yes this would be awesome. Though I think solarsnowfall already made a feature suggestion thread on it.
Regarding the TID of 0 uses activator - yes this would be awesome. Though I think solarsnowfall already made a feature suggestion thread on it.
- Theshooter7
- Posts: 456
- Joined: Sun Mar 05, 2006 6:44 pm
- Theshooter7
- Posts: 456
- Joined: Sun Mar 05, 2006 6:44 pm
You'll need to learn how to code in C++. ACS is *kind of* a stripped down version of C so some stuff might look familiar but that's about it.
The source code is a totally different monster than what you're used to seeing in DECORATE... it all began when there was this heated discussion about a custom HUD scripting language going on. It was closed eventually, but then I thought to myself "hmm maybe I should just try implementing it myself".
Then it was one of those weird nights for me again, where I would just wake up for no reason at like 4 or 5 in the morning. I proceeded to install Microsoft Visual C++, and went straight into the GZDoom source. I was apparently learning C++ then and there. o_O A bunch of tutorials here and there and in a few minutes I was already making a custom GZDoom.exe... my first modification was a totally redesigned Options menu for my project.
Nothing fancy, but it was from then on that I slowly expanded my (limited) C++ knowledge.
The source code is a totally different monster than what you're used to seeing in DECORATE... it all began when there was this heated discussion about a custom HUD scripting language going on. It was closed eventually, but then I thought to myself "hmm maybe I should just try implementing it myself".
Then it was one of those weird nights for me again, where I would just wake up for no reason at like 4 or 5 in the morning. I proceeded to install Microsoft Visual C++, and went straight into the GZDoom source. I was apparently learning C++ then and there. o_O A bunch of tutorials here and there and in a few minutes I was already making a custom GZDoom.exe... my first modification was a totally redesigned Options menu for my project.
Nothing fancy, but it was from then on that I slowly expanded my (limited) C++ knowledge.
- Theshooter7
- Posts: 456
- Joined: Sun Mar 05, 2006 6:44 pm
I know some C++. For your tutorials, did you just read some typical standard stuff (like from cprogramming.com) or was there some specifics for (G)ZDoom Source editing that I am not aware of?
Also, so where is all the Decorate Related Coding? What are the names of the Headers and CPP Files?

Also, so where is all the Decorate Related Coding? What are the names of the Headers and CPP Files?
I hope I generated the patch correctly...
As for testing; yes, it works. I've incorporated it into nashgore.wad.
Code: Select all
Index: zdoom/trunk/src/thingdef.cpp
===================================================================
--- zdoom/trunk/src/thingdef.cpp (revision 371)
+++ zdoom/trunk/src/thingdef.cpp (working copy)
@@ -682,7 +682,7 @@
FUNC(A_StopSoundEx, "T" )
FUNC(A_SeekerMissile, "XX" )
FUNC(A_Jump, "XL+" )
- FUNC(A_CustomMissile, "MXXxxx" )
+ FUNC(A_CustomMissile, "MXXxxxx" )
FUNC(A_CustomBulletAttack, "XXXXmx" )
FUNC(A_CustomRailgun, "Xxccxxx" )
FUNC(A_JumpIfHealthLower, "XL" )
Index: zdoom/trunk/src/thingdef_codeptr.cpp
===================================================================
--- zdoom/trunk/src/thingdef_codeptr.cpp (revision 371)
+++ zdoom/trunk/src/thingdef_codeptr.cpp (working copy)
@@ -617,7 +617,7 @@
//==========================================================================
void A_CustomMissile(AActor * self)
{
- int index=CheckIndex(6);
+ int index=CheckIndex(7);
if (index<0) return;
ENamedName MissileName=(ENamedName)StateParameters[index];
@@ -626,6 +626,7 @@
angle_t Angle=angle_t(EvalExpressionF (StateParameters[index+3], self) * ANGLE_1);
int aimmode=EvalExpressionI (StateParameters[index+4], self);
angle_t pitch=angle_t(EvalExpressionF (StateParameters[index+5], self) * ANGLE_1);
+ INTBOOL transfer_translation = EvalExpressionI (StateParameters[index+6], self);
AActor * targ;
AActor * missile;
@@ -716,6 +717,12 @@
{
missile->health=-2;
}
+
+ // [Nash] transfer translation to missile
+ if (transfer_translation)
+ {
+ missile->Translation = self->Translation;
+ }
}
}
}