I'm looking for a replacement magic book. That makes the magic explode when it dies instead of the usual fire effect.
Edited by Jambu, 21 April 2024 - 09:25 AM.
Posted 19 April 2024 - 08:21 AM
I'm looking for a replacement magic book. That makes the magic explode when it dies instead of the usual fire effect.
Edited by Jambu, 21 April 2024 - 09:25 AM.
Posted 23 April 2024 - 12:17 PM
lweapon script magicbookworstitem{ void run(int book_id = 32){ if (player->Item[book_id] == -1){ quit(); //Do nothing we don't got a book! } if (this->DeadState == 0){ //is the weapon about to die? lweapon boom = Create->LWeapon(LW_BOMBBLAST) boom->x = this->x boom->y = this->y } } }
I tried writing it myself. but i get an error
Posted 23 April 2024 - 09:41 PM
"player" should be "Player".
Posted 23 April 2024 - 10:06 PM
I got my first script to compile. I attached it to the weapon slot for the wand and magicbook (I'm not sure which one is correct) and the magic isn't exploding...
//causes magic to explode on death. lweapon script magicbookworstitem{ void run(int book_id = 32){ if (Player->Item[book_id] == -1){ Quit(); } lweapon boom = Screen->CreateLWeapon(LW_BOMBBLAST); boom->X = this->X; boom->Y = this->Y; } }
Posted 23 April 2024 - 10:44 PM
You probably want `unless(Player->Item[book_id])` instead of `if(Player->Item[book_id] == -1)`.
Also, uh, booleans generally will only be `true` or `false`, never `-1`.
Posted 24 April 2024 - 12:04 PM
Works now thanks for your help again you two.
My only missgiving is when it hits mirrors it explodes. Which is find in it's own way since the magic duplicated also explodes.
Edited by Jambu, 24 April 2024 - 12:06 PM.
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 |
|
|
||
|
Alpha
Zelda Classic →
ZC Development →
Zelda Classic 2.55 Alpha 17 (Official)Started by Timelord , 09 Apr 2019 Alpha, Æternal, AEternal, 2.55 and 4 more... |
|
|
|
Zelda Classic →
Scripting Discussion →
Script Requests →
Magic ArrowStarted by Aefre , 07 Jul 2018 Item |
|
|
0 members, 4 guests, 0 anonymous users