I see a few ways that using an inherent flag here would create potential bugs.
None of them, would affect the combo tile.
Posted 12 January 2018 - 12:24 AM
I see a few ways that using an inherent flag here would create potential bugs.
None of them, would affect the combo tile.
Posted 13 January 2018 - 11:02 AM
Did I modify the script correctly? (Regarding the ++variable as well as the changes to the sword power trigger)
It seems to work fine, though I haven't testing the sword changing yet.
import "std.zh" const int CR_SWORDPART = 10; //The 'Script / Custom 4' counter. int I_HUNDRED_PIECE_SWORD = 123; //Custom item 1 const int HUNDRED_PIECE_SWORD_BASE_POWER = 1; //The minimum damage of the sword, before it is upgraded. //A pick-up/collect script. Attach to a sword piece item. //If you want ZC to display a screen string when the player picks it up, assign the ZQuest String ID //to the D0 arg. //If you want a special message when the player collects ten pieces, assign that ZQuest //string to the D1 arg. //If you want this to play a special sound if the player picks up ten pieces, assign that Sound Effect //ID to the D2 arg. //!Dimentio Edit: Fixed decimal values being passed to sword->Power, //!Fixed bug where having 10-19 sword pieces is the same as having 0-9. item script swordpart { void run(int msg_id, int special_msg_id, int special_sfx) { ++Game->Counter[CR_SWORDPART]; itemdata sword = Game->LoadItemData(I_HUNDRED_PIECE_SWORD); sword->Power = Max((Floor(Game->Counter[CR_SWORDPART] / 10) + 1), HUNDRED_PIECE_SWORD_BASE_POWER); if ( Game->Counter[CR_SWORDPART] % 10 || special_msg_id < 1 ) { Screen->Message(msg_id); } else { Screen->Message(special_msg_id); if ( Game->Counter[CR_SWORDPART] % 10 == 0 && special_sfx ) { Game->PlaySound(special_sfx); ++I_HUNDRED_PIECE_SWORD; Link->Item[I_HUNDRED_PIECE_SWORD] = true; } } } } //Assign this to global slot 4 ('onContinue') //This re-applies the power modifications to the sword, every time that the player returns to //the game, after exiting. //!Dimentio Edit: Fixed decimal values being passed to sword->Power, //!Fixed bug where having 10-19 sword pieces is the same as having 0-9. global script OnContinue { void run() { itemdata sword = Game->LoadItemData(I_HUNDRED_PIECE_SWORD); sword->Power = Max((Floor(Game->Counter[CR_SWORDPART] / 10) + 1), HUNDRED_PIECE_SWORD_BASE_POWER); } } //!Dimentio Edit: This entire ffc script + comments. Sorry Zoria, I don't think your method was the most efficient. //D0: Number of pieces you need to own to trigger //D1: Flag to trigger //The way this works is that it changes all combos with flag D1 to the wooden sword trigger flag. //Leaving things to the engine is generally a safe way to do thing. //This also means you only need one script of this running. const int HUNDRED_PIECE_SWORD_FLAG = 102; //Script 5 ffc script sword_power_triggers { void run(int power, int flag) { if ( flag < 1 ) flag = HUNDRED_PIECE_SWORD_FLAG; { while(true) { if (Game->Counter[CR_SWORDPART] >= power) { for (int i = 0; i < 176; i++) { if (Screen->ComboF[i] == flag) { Screen->ComboF[i] = CF_SWORD1; } if (Screen->ComboI[i] == flag) { Screen->ComboI[i] = CF_SWORD1; } } } Waitframe(); } } } }
Edited by Smiles the Death Bringer, 13 January 2018 - 11:04 AM.
Posted 13 January 2018 - 09:18 PM
I see a few ways that using an inherent flag here would create potential bugs.
None of them, would affect the combo tile.
Zoria, the bug is caused by the inherent flag being set globally sword trigger flag due to a script error. Thus, on a screen with secrets not set properly, all combos would be turned into combo 0 upon swinging the sword.
Posted 08 July 2020 - 08:19 AM
Zoria, the bug is caused by the inherent flag being set globally sword trigger flag due to a script error. Thus, on a screen with secrets not set properly, all combos would be turned into combo 0 upon swinging the sword.
Someone gravedug this outside of the thread. Just wanted to say, that this remark is correct. Writing ComboI[] is a ba way to do this. It presumes that once you collect the require item power, that you want all such triggers in the game to have the sword property as soon as one is triggered. If you do not, then you do not want to use ComboI[] at all.
The script should likely have a bool universe argument, to check and write ComboI[]. This is somewhat surpassed by Generic trigger combos now, as you can set a minimum item level, and select sword weapon types.
item
Zelda Classic →
Scripting Discussion →
Modular item scriptsStarted by DigitalDetective47 , 25 May 2024 item |
|
|
||
Zelda Classic →
Scripting Discussion →
Script Requests →
Fire and Ice Arrows 2.55Started by Blackpaintbowser , 28 Aug 2022 arrows, item, 2.55 |
|
|
||
Zelda Classic →
ZC Development →
ZC Bug Reports →
[2.55] Problems with the WhistleStarted by Korben , 27 May 2021 [New], [Item] |
|
|
||
Zelda Classic →
ZQuest Editor Help →
Item/Enemy Sprite EditorStarted by Riflezen , 23 Sep 2019 NPC, Item |
|
|
||
Zelda Classic →
ZC Development →
ZC Bug Reports →
Invisible Subscreen icon?Started by Thunderfist , 10 Apr 2019 Invisible Subscreen Sword con and 3 more... |
|
|
0 members, 1 guests, 0 anonymous users