Jump to content

astSeenBY


erebusant

Recommended Posts

I did a search of the forums and only found a couple posts that referred to a typical line you run across in Ascension scripts. That line being !Dead("astSeenBy())"). From what I understood this is a decompiler bug that remains permanent in the mods files once t is recompiled? I just want to verify this particular error should be replaced by !StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD before going through and changing things, because there are several of those errors in many scripts.

Link to comment

If you change !Dead("astSeenBy())") to !Dead("LastSeenBy())") and recompile the script the warning still remains. If you replace it totally with !StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD or !StateCheck(LastSeenBy(),STATE_DEAD) and recompile then the warning disappears. The question actually was, is the replacement doing the same thing as the original intent?

Link to comment
If you change !Dead("astSeenBy())") to !Dead("LastSeenBy())") and recompile the script the warning still remains.

Quotes make the engine look for a DV, not an object, so the problem remains.

 

If you replace it totally with !StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD or !StateCheck(LastSeenBy(),STATE_DEAD) and recompile then the warning disappears. The question actually was, is the replacement doing the same thing as the original intent?

STATE_DEAD is not enough, as it misses the various other state forms of death (STATE_ACID_DEATH, STATE_EXPLODING_DEATH, etc.). This is why FP introduced the custom STATE_REALLY_DEAD which includes all of these.

 

For those wondering why you can't just use Dead(LastSeenBy()), Dead() does not accept objects, only DVs. Even if you alter trigger.ids so that it does accept objects, it never returns true (Sim tested this).

Link to comment
Thanks for the clarification CamDawg

Everything I've learned, it's because I did all of the other wrong things I've pointed out first. :)

 

@erebusant

Putting on my Cap'n Obvious hat for a moment, don't forget to append STATE_REALLY_DEAD to states.ids (or go devSin and just use the numerical value directly). :)

Link to comment

4032, baby!

 

In all honesty, STATE_DEAD should be pretty safe. As soon as a creature actually dies, STATE_DEAD should be reliably set (if you're stoned or frozen, STATE_DEAD doesn't get set until you explode). This can be useful for targeting where you might not want to have an enemy totally avoid stoned or frozen characters who still need to be chunked.

Link to comment

I "borrowed" the Fixpack code and modified it a bit to suit the needs of Ascension, anyway. Is STATE_DEAD better to uhan STATE_REALLY_DEAD, or does it matter?

BEGIN ~Fix Various "astXXXby triggers in many scripts~

COPY + ~Setup-astScriptPatcher.exe~ ~WeiDU.exe~
COPY + ~chitin.key~ ~astScriptPatcher/chitin.asp~
COPY_LARGE + ~dialog.tlk~ ~astScriptPatcher/dialog.asp~


COPY_EXISTING	~ABAZ3.BCS~				~override~
		~BALELIT1.BCS~			~override~
		~BALELIT2.BCS~			~override~
		~BALELIT3.BCS~			~override~
		~BALELIT4.BCS~			~override~
		~BALTALLY.BCS~			~override~
		~D0AMTHEA.BCS~			~override~
		~D0AMTMAG.BCS~			~override~
		~D0AMTMER.BCS~			~override~
		~D0EDWINH.BCS~			~override~
		~DRAKE01.BCS~			~override~
		~DRAKE02.BCS~			~override~
		~DRAKE03.BCS~			~override~
		~DRAKE04.BCS~			~override~
		~DW#ASC_FINSEND.BCS~		~override~
		~DW#ASC_ILLASERA.BCS~		~override~
		~FINBALOR.BCS~			~override~
		~FINBALTH.BCS~			~override~
		~FINMARIL.BCS~			~override~
		~FINMEL.BCS~			~override~
		~FINSAREV.BCS~			~override~
		~RAMAZ.BCS~				~override~

DECOMPILE_BCS_TO_BAF

REPLACE_TEXTUALLY %Dead("yself)")% %StateCheck(Myself,STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("yself)")% %!StateCheck(Myself,STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astSeenBy())")% %StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astSeenBy())")% %!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astTargetedBy(")% %StateCheck(LastTargetedBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astTargetedBy(")% %!StateCheck(LastTargetedBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astAttackerOf(Myself))")% %StateCheck(LastAttackerOf(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astAttackerOf(Myself))")% %!StateCheck(LastAttackerOf(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astTargetedBy(Player1))")% %StateCheck(LastTargetedBy(Player1),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astTargetedBy(Player1))")% %!StateCheck(LastTargetedBy(Player1),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astSeenBy(Myself))")% %StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astSeenBy(Myself))")% %!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astHeardBy())")% %StateCheck(LastHeardBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astHeardBy())")% %!StateCheck(LastHeardBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astHeardBy(Myself))")% %StateCheck(LastHeardBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astHeardBy(Myself))")% %!StateCheck(LastHeardBy(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astAttackerOf(Player1))")% %StateCheck(LastAttackerOf(Player1),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astAttackerOf(Player1))")% %!StateCheck(LastAttackerOf(Player1),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %Dead("astAttackerOf(")% %StateCheck(LastAttackerOf(Myself),STATE_REALLY_DEAD)%
REPLACE_TEXTUALLY %!Dead("astAttackerOf(")% %!StateCheck(LastAttackerOf(Myself),STATE_REALLY_DEAD)%

COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES

Link to comment

This is because the parameter type confusion for the Dead trigger.

Some engine versions use strictly a string (like bg2), and some use an object specification (like iwd2).

 

Apparently in some cases even the original game creators were confused by this.

Link to comment
DW#ASC_FINSEND.BCS and DW#ASC_ILLASERA.BCS are SCSII scripts actually - let me know what's wrong with them (some copied bit of Ascension code?) and I'll fix them locally.

If those two files are derived by copying the original Ascension files and appending to them, then they will be repaired prior to SCSII installation once the revamped version gets released.

 

If you want to account for an older version of Ascension being installed, the problems occur in lines 74 & 113 in Illasera, and 1278, 1679, 1695, & 1769 in Sendai.

Link to comment

DW#ASC_FINSEND.BCS and DW#ASC_ILLASERA.BCS are SCSII scripts actually - let me know what's wrong with them (some copied bit of Ascension code?) and I'll fix them locally.

If those two files are derived by copying the original Ascension files and appending to them, then they will be repaired prior to SCSII installation once the revamped version gets released.

 

Cool - but in that case you probably don't want to be referencing them in your TP2 (because it sounds as if your mod (revamped Ascension, yes?) will be installed before SCSII and so before those files are created).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...