[ACS/Decorate] Modding The Sigil Made Easy (V1.1)

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!

[ACS/Decorate] Modding The Sigil Made Easy (V1.1)

Postby FishyClockwork » Wed Jan 16, 2013 6:28 pm

Inspired by this thread I decided to emulate the Sigil in DECORATE using no restricted functions nor inheriting from the Sigil actor itself. I've done the best that I could based on what I could interpret from the source code.

The ACS part, aside from one little script, is mostly to make this new, fake Sigil compatible with the game's stock maps and enemies (AlienSpectre5).

What I got in the end is a pretty accurate replica(I think).
[EDIT] Updated ACS code (Old version) with Nightfall's suggestions. [/EDIT]
*************************************
[EDIT2]So, yesterday I had an (rather bizzare, me thinks) idea. How about using the Sigil itself as a piece-counter for the fake Sigil? To be specific, why not use the native GetSigilPieces() function? From that came other strange ideas (about how to implement this)...and from brainstorming to realization I give you a new version. (I shall call it V1.1 :P )

Like I promised, it's a little less decorate and ACS code but it's a bit more hackish, IMO. And it's compatible. (even with the status bar!)
Basically, in this version the Sigil and the NNSigil are 'connected' so to speak. However, I realize that some of you may not like this new version. So I've left the older version just in case.

On a minor note, I have included Ed the Bat's corrections (slightly altered) in both versions to make it slightly more faithful to the original on a technical level.
On another minor note, thanks to a recent bugfix I've removed the 'Drop' actors in the 'Old version' and moved their 'Drop' state to the 'Pickup' actors, where it belongs.[/EDIT2]

[minor edit(3)]slightly reworded what was posted in EDIT2 to make myself more clear[/minor edit(3)]
*************************************
[EDIT4]Fixed some obscure bugs after reading this wonderful news. Well actually I first wanted to see if the A_Light# bug was still present(It wasn't :)), but then discovered other unwanted problems.

1) When firing the fake Sigil while picking up another piece, the attack type would be that of the new piece amount instead of what it's supposed to be. Eg. if you have 3 pieces, fire it, then pickup another piece, you would shoot the tall, vertical lightning column instead of the spread shot. It would also change to represent four pieces without going through the "lowering and rising" animation.
This was fixed by moving/copying the following code from the 'Fire' state to the 'Fire1/2/3/4/5' states.
Code: Select allExpand view
      "----" A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
      "----" A 18 Bright A_Light2
      "----" A 3 Bright A_GunFlash
      TNT1 A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
(Why on Earth didn't I realize this sooner. *sigh*)

2) It seems that, just like any actors, weapons will ignore the codepointer in the first frame in their 'Select' state ('Ready' state if the map has 'SpawnWithWeaponRaised' set) when transitioning maps.
Actually, it seems that weapons are a bit unique. If the first frame is 0 tics long (not sure about this bit) and if subsequent frames are 0-tic frames, all the codepointers (if any) will be ignored until there is a frame that is at least 1 tic long (not sure if the codepointer on that last frame will be ignored or not).
This bug was fixed earlier, but I decided to 'refix' it by duplicating the first A_Jump* function. This way when you switch maps it would ignore the first call, but it would act on the second, identical one. And switching weapons will not delay 'Select/Ready' by one tic before calling A_Raise/A_WeaponReady. (Now I'm being picky and a hypocrite :P)

3) In the 'New version', if you have the fake Sigil selected and if you entered a new map, or revisited a previous one in which the amount of pieces you had was different from the amount you have now, the fake Sigil would run it's upgrade animation hack when it's obviously not necessary. This one is really obscure because it only happened on maps that have 'SpawnWithWeaponRaised' set. Updated ACS code (New version). See the commentary there for relevant bits.
Spoiler: On a minor, completely irrelevant note
This should be the last update since I pretty much consider this thing done.[/EDIT4]

Spoiler: Old version

New version:
Spoiler: DECORATE

Spoiler: ACS

Spoiler: MAPINFO, for the sake of completeness (you don't really need it)


The reason why I post this here (in Resources) is because I want to see what people might do with the sigil since, I imagine, they get discouraged by realizing that you can't really do anything useful with it except maybe replace the projectiles. And also because I lack creativity, heh.
So yeah, this thing should pretty much behave like the real sigil. Copy-paste what you want and change to your liking. You don't have to give me credit if you don't care. :P Just do something crazy with it.

Dear moderators,
If you feel like this doesn't belong in Resources then please move it elsewhere. (I don't wish to be a nuisance.)
Last edited by FishyClockwork on Fri Jan 25, 2013 7:10 pm, edited 4 times in total.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: [ACS/Decorate] Modding The Sigil Made Easy (I hope)

Postby Nightfall » Wed Jan 16, 2013 7:41 pm

Code: Select allExpand view
if( !PlayerFound && PlayerInGame(1) )
   {
      SetActivator(0, AAPTR_PLAYER2);
      if( GetActorProperty(0, APROP_Health) > 0 )
         PlayerFound = true;
   }


Instead of horribly copy-pasting that block 8 times I'd rather suggest something like this:

Code: Select allExpand view
for (int i = 0; i < 8; i++) {
   if (!PlayerFound && PlayerInGame (i)) {
      SetActivator (0, AAPTR_PLAYER1 << i);
      if (GetActorProperty (0, APROP_Health) > 0)
         PlayerFound = true;
   }
}

Didn't test but it should work..

Code: Select allExpand view
switch( CheckInventory("NNSigilPiece") )
   {
   default:
   case 1:
      SpawnSpot("NNSigil1Pickup", 0);
      break;
   case 2:
      SpawnSpot("NNSigil2Pickup", 0);
      break;
   case 3:
      SpawnSpot("NNSigil3Pickup", 0);
      break;
   case 4:
      SpawnSpot("NNSigil4Pickup", 0);
      break;
   case 5:
      SpawnSpot("NNSigil5Pickup", 0);
      break;
   }

And this I believe could be broken down into
Code: Select allExpand view
int piece = CheckInventory("NNSigilPiece");
if (piece >= 1 && piece <= 5)
   SpawnSpot (strparam (s:"NNSigil", d:piece, s:"Pickup"), 0);
User avatar
Nightfall
 
Joined: 06 Aug 2009
Location: Finland

Re: [ACS/Decorate] Modding The Sigil Made Easy (I hope)

Postby FishyClockwork » Thu Jan 17, 2013 8:46 am

Thanks, Nightfall. :) I'll update the first post right away. Hope you don't mind if I alter your suggestions just a little bit.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: [ACS/Decorate] Modding The Sigil Made Easy (I hope)

Postby Ed the Bat » Thu Jan 17, 2013 1:47 pm

One small error I spotted with NNSigilLightningSpot and NNSigilLightningBigV is that, when they call Goto Super::Spawn, they'll trigger the codepointers in the first frame of their parents' Spawn class, which doesn't happen in the original. This means A_CountDown or A_Tracer2 get called one time too early/often. You might want to tweak them thusly:
Code: Select allExpand view
ACTOR NNSigilLightningSpot : SpectralLightningSpot
{
   +SPECTRAL   //This flag is needed, otherwise the SpectralLightningV1/V2
   States      //actors won't damage the spectres. Wierd.
   {
   Spawn:
      TNT1 A 0
      TNT1 A 0 A_TransferPointer(AAPTR_TARGET,AAPTR_DEFAULT,AAPTR_PLAYER_GETTARGET,AAPTR_TRACER)
      TNT1 A 0 A_CheckFlag("SHOOTABLE","Enemy",AAPTR_TRACER)
      TNT1 A 0 A_Warp(AAPTR_TARGET)   //Try to stick to the player's feet.
      TNT1 A 0 A_ChangeVelocity(28,0,0,CVF_RELATIVE|CVF_REPLACE)
      ZAP5 A 4 BRIGHT
      Goto Super::Spawn+1
   Enemy:
      TNT1 A 0 A_Warp(AAPTR_TRACER, 0,0,0, 0, WARPF_NOCHECKPOSITION|WARPF_STOP|WARPF_TOFLOOR)
      ZAP5 A 4 BRIGHT
      Goto Super::Spawn+1
   }
}

Actor NNSigilLightningBigV : SpectralLightningBigV1
{
   Decal "BaronScorch"
   States
   {
   Spawn:
      TNT1 A 0
      TNT1 A 0 A_TransferPointer(AAPTR_TARGET, AAPTR_DEFAULT, AAPTR_PLAYER_GETTARGET, AAPTR_TRACER)
      TNT1 A 0 A_CheckFlag("SHOOTABLE", "Super::Spawn", AAPTR_TRACER)
      TNT1 A 0 A_ChangeVelocity(28,0,0, CVF_RELATIVE)
      ZOT2 A 4 BRIGHT
      Goto Super::Spawn+1
   }
}

Basically, just add a dummy state before jumping to the parent, so simulate the effect of the first state after Spawning doing nothing.
User avatar
Ed the Bat
I'm tired. I want to go home.
 
Joined: 03 May 2012
Location: Maryland, US

Re: [ACS/Decorate] Modding The Sigil Made Easy (I hope)

Postby FishyClockwork » Thu Jan 17, 2013 5:19 pm

I'm not that picky, Ed, :P but I'll consider it. Besides, I'm working on an alternative way for the upgrade animation hack, which is kinda similar to what you suggested, and something else.

If I get this done, which should take a day or two (unless something in my life gets in the way), it would cut down both the decorate and ACS code as well as make this compatible with the stock game, whether you care about compatibility or not :P

Right now, I need some sleep.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: [ACS/Decorate] Modding The Sigil Made Easy (I hope)

Postby Ed the Bat » Thu Jan 17, 2013 5:27 pm

FishyClockwork wrote:I'm not that picky, Ed, :P

That's fine, I've got enough picky in me to go 'round. :)
User avatar
Ed the Bat
I'm tired. I want to go home.
 
Joined: 03 May 2012
Location: Maryland, US

Re: [ACS/Decorate] Modding The Sigil Made Easy (V1.1)

Postby FishyClockwork » Fri Jan 18, 2013 10:56 am

Updated first post with a new version. (the old one is still there)
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: [ACS/Decorate] Modding The Sigil Made Easy (V1.1)

Postby Edward-san » Fri Jan 18, 2013 3:56 pm

Any chance this code could be put inside zdoom.pk3? :D
Edward-san
Mathematics is the language with which God has written the universe. (Galilei)
 
Joined: 17 Oct 2009

Re: [ACS/Decorate] Modding The Sigil Made Easy (V1.1)

Postby FishyClockwork » Fri Jan 25, 2013 7:14 pm

Updated first post, fixed a few bugs.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011


Return to Resources

Who is online

Users browsing this forum: No registered users and 1 guest