Jump to content

Dead Money Chip Reward Script help


7luckyrabbit

Recommended Posts

I have been trying to mod a script for the chip reward for when you finish DM.

Thought it was easy to do but now I am running into a problem.

Everytime I tried to save my script it gives me a error that line 28's if/else/endif block is mismatched and a simliar error afterwards.

 

For the record here is the script:

scn NVDLC01ChipRewardSCRIPT

;This script controls the Sierra Madre Chip reward after completing NVDLC01
;CES 10/26/10

;Variables

short bChipsRewarded
short aSpaceAgeKnifeRewarded
short iTotalRewards
float fChipDelay
float fCloudResidueDelay
float lSpaceAgeKnifeDelay

short bCompsRewarded
short iTotalComps
float fCompsDelay

BEGIN GameMode

if (NVDLC01ElijahsChemistrySetREF.bResidueGathered == 1)
if (GameDaysPassed > fCloudResidueDelay )
set NVDLC01ElijahsChemistrySetREF.bResidueGathered to 1
NVDLC01ElijahsChemistrySetREF.SetDestroyed 0
endif
endif

if (bChipsRewarded == 1) <===here is the supposed problem
if (GameDaysPassed > fChipDelay)
set bChipsRewarded to 0

if (aSpaceAgeKnifeRewarded == 1)
if (GameDaysPassed > lSpaceAgeKnifeDelay)
set aSpaceAgeKnifeRewarded to 0
endif
endif
else
NVDLC01ElijahsDropboxREF.additem NVDLC01SierraMadreChip 100
NVDLC01ElijahsDropboxREF.additem NVDLC01SpaceAgeKnife 1
set bChipsRewarded to 1
set aSpaceAgeKnifeRewarded to 1
set iTotalRewards to iTotalRewards + 1
set fChipDelay to GameDaysPassed + 3
set lSpaceAgeKnifeDelay to GameDaysPassed + 3
endif

;CES 1/04/11 - Updating this to only happen when you have triggered the HUGE reward
if (NVDLC01CasinoComps.bHuge == 1)
if (bCompsRewarded == 1)
if (GameDaysPassed > fCompsDelay)
set bCompsRewarded to 0
endif
else
NVDLC01ElijahsDropboxREF.additem NVDLC01FinalCompVoucher 1
set bCompsRewarded to 1
set iTotalComps to iTotalComps + 1
set fCompsDelay to GameDaysPassed + 3
endif
endif

END ;GameMode

Edited by 7luckyrabbit
Link to comment
Share on other sites

Each "if" statement has to have a corresponding "endif" statement AND when "nesting" "if"s, the first encountered "endif" terminates the last nested "if" statement block.

 

So:

 if (bChipsRewarded == 1)  <===here is the supposed problem
        if (GameDaysPassed > fChipDelay)
            set bChipsRewarded to 0

    if (aSpaceAgeKnifeRewarded == 1)
        if (GameDaysPassed > lSpaceAgeKnifeDelay)
            set aSpaceAgeKnifeRewarded to 0
            endif
        endif
    else

indentation is misleading. (indentation is only of use to the coder, but is essential to identifying such situations. The parser ignores multiple spaces.) What you actually have (as far as the parser is concerned) is:

 if (bChipsRewarded == 1)  <===here is the supposed problem
        if (GameDaysPassed > fChipDelay)
            set bChipsRewarded to 0

            |=> indented to show how it is viewed by the parser
            if (aSpaceAgeKnifeRewarded == 1)
              if (GameDaysPassed > lSpaceAgeKnifeDelay)
                 set aSpaceAgeKnifeRewarded to 0
              endif
            endif
        ; missing "endif"
 |<= logical indentation point corresponding to initial "if"
 else

and what you intended (based upon the indentation and the error indicating you are missing a block terminator) is:

 if (bChipsRewarded == 1)  <===here is the supposed problem
        if (GameDaysPassed > fChipDelay)
            set bChipsRewarded to 0
        ; changed "if" to "elseif"
        elseif (aSpaceAgeKnifeRewarded == 1)
            if (GameDaysPassed > lSpaceAgeKnifeDelay)
               set aSpaceAgeKnifeRewarded to 0
            endif
        endif
 |<= logical indentation point corresponding to initial "if"
 else

You have a similar problem in the section below that.

 

-Dubious-

Link to comment
Share on other sites

Each "if" statement has to have a corresponding "endif" statement AND when "nesting" "if"s, the first encountered "endif" terminates the last nested "if" statement block.

 

So:

 if (bChipsRewarded == 1)  <===here is the supposed problem
        if (GameDaysPassed > fChipDelay)
            set bChipsRewarded to 0

    if (aSpaceAgeKnifeRewarded == 1)
        if (GameDaysPassed > lSpaceAgeKnifeDelay)
            set aSpaceAgeKnifeRewarded to 0
            endif
        endif
    else

indentation is misleading. (indentation is only of use to the coder, but is essential to identifying such situations. The parser ignores multiple spaces.) What you actually have (as far as the parser is concerned) is:

 if (bChipsRewarded == 1)  <===here is the supposed problem
        if (GameDaysPassed > fChipDelay)
            set bChipsRewarded to 0

            |=> indented to show how it is viewed by the parser
            if (aSpaceAgeKnifeRewarded == 1)
              if (GameDaysPassed > lSpaceAgeKnifeDelay)
                 set aSpaceAgeKnifeRewarded to 0
              endif
            endif
        ; missing "endif"
 |<= logical indentation point corresponding to initial "if"
 else

and what you intended (based upon the indentation and the error indicating you are missing a block terminator) is:

 if (bChipsRewarded == 1)  <===here is the supposed problem
        if (GameDaysPassed > fChipDelay)
            set bChipsRewarded to 0
        ; changed "if" to "elseif"
        elseif (aSpaceAgeKnifeRewarded == 1)
            if (GameDaysPassed > lSpaceAgeKnifeDelay)
               set aSpaceAgeKnifeRewarded to 0
            endif
        endif
 |<= logical indentation point corresponding to initial "if"
 else

You have a similar problem in the section below that.

 

-Dubious-

Thank you. I got it fixed.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...