7luckyrabbit Posted April 5, 2019 Share Posted April 5, 2019 (edited) 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;Variablesshort bChipsRewardedshort aSpaceAgeKnifeRewardedshort iTotalRewardsfloat fChipDelayfloat fCloudResidueDelayfloat lSpaceAgeKnifeDelayshort bCompsRewardedshort iTotalCompsfloat fCompsDelayBEGIN 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 endifEND ;GameMode Edited April 5, 2019 by 7luckyrabbit Link to comment Share on other sites More sharing options...
dubiousintent Posted April 5, 2019 Share Posted April 5, 2019 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 elseindentation 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" elseand 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" elseYou have a similar problem in the section below that. -Dubious- Link to comment Share on other sites More sharing options...
7luckyrabbit Posted April 6, 2019 Author Share Posted April 6, 2019 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 elseindentation 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" elseand 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" elseYou have a similar problem in the section below that. -Dubious-Thank you. I got it fixed. Link to comment Share on other sites More sharing options...
Recommended Posts