Add translation parameter to all spawning functions

Moderator: GZDoom Developers

User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Add translation parameter to all spawning functions

Post by Nash »

Including the ACS spawn and projectile functions, and the custommissile codepointers in DECORATE, etc.

If not for completeness' sake.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

Well, while we are at it, I suggest other action specials (Like Thing_Projectile, Radius_Quake, Thing_Activate, etc.) having a TID of 0 uses the Activator.

I also agree with Nash.
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

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.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

I am aware. But he only mentioned Thing_Projectile and it's derivitives. (sp?) I am simply suggesting everything to be treated similar.
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I've added a translation parameter for A_CustomMissile... using TortoiseSVN, how do I submit my change?

(Wheee my first ZDoom source contribution! :P)
User avatar
Necromage
Posts: 484
Joined: Thu Feb 10, 2005 3:13 pm
Location: NJ
Contact:

Post by Necromage »

Create a diff patch and post it here, TortoiseSVN has the ability to do this but I am not sure how it works.
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Nevermind, I somehow missed the "SVN Commit" option in the right-click menu.

I'm waiting for someone to check the "Cacodemon moves super fast" bug though before committing my changes.
User avatar
Necromage
Posts: 484
Joined: Thu Feb 10, 2005 3:13 pm
Location: NJ
Contact:

Post by Necromage »

I have never tried it but the zdoom svn should disallow you from committing.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

You actually figured something out in the Source? :shock:

I can't seem to find any of the Decorate Related Code at all. I also am having a hard time understanding the classes.
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

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.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

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?
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I can't remember. I just Googled "C++ tutorials".

Also, your question isn't specific. At any rate, try looking at the thingdef* files. Or if you're using MSVC++, just look under the "Decorate++" folder.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

Necromage wrote:I have never tried it but the zdoom svn should disallow you from committing.
I think you can't commit your changes to the SVN unless you're Randy or Graf. If anyone was able to commit anything, it would become huge mess.
User avatar
Necromage
Posts: 484
Joined: Thu Feb 10, 2005 3:13 pm
Location: NJ
Contact:

Post by Necromage »

Grubber wrote:I think you can't commit your changes to the SVN unless you're Randy or Graf. If anyone was able to commit anything, it would become huge mess.
Exactly
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I hope I generated the patch correctly...

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;
+				}
 			}
 		}
 	}
As for testing; yes, it works. I've incorporated it into nashgore.wad.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”