Shield works great. Thank you for this nice work.
But after destroying the shild it dosn´t shrink. It is destroyed. Is that right so?
The original goromorg shild shrinks after destroying. Have I done something wrong by scripting? I´ve found no mistakes in my scripts.
[SCRIPT] Goromorg Shield (v1.1 update)
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Hi maneus,
What do you mean, it doesn't shrink? Are talking about an animation effect? If so yes, it won't do it because it's a simulation of the effect to recreate it, it's not the real shield.
What do you mean, it doesn't shrink? Are talking about an animation effect? If so yes, it won't do it because it's a simulation of the effect to recreate it, it's not the real shield.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Yes I wrote about the animation effect. Thank you for the answer Diarmuid.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Me again.
I get another problem with the shield.
I wish to spawn a monster with that shield by activating a pressure plate. The monster spawned but when I hit the monster in the editor I get the following message:
Is that a bug?
When I place a monster with shield somewhere in my dungeon the shield works perfectly. But spawning a monster with shield, it dosn´t work.
I get another problem with the shield.
I wish to spawn a monster with that shield by activating a pressure plate. The monster spawned but when I hit the monster in the editor I get the following message:
SpoilerShow
When I place a monster with shield somewhere in my dungeon the shield works perfectly. But spawning a monster with shield, it dosn´t work.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
without looking into a proper solution, perhaps you could just park the monster in a closed off room far in the corner of the map or something, then just teleport it in instead of spawning in
Finished Dungeons - complete mods to play
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Thank you Komag, that was a good idea. It works very well.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
I know what the bug is.
Well it seems the fxId is incorrect, which is based on the monster id (monster.id..".shield"). So if your monster is named snail_1, the shield particle will be named snail_1.shield.
When you spawn a monster without specifiying an id, for example spawn("snail", level, x, y, facing), it generates a random numerical id, like 24536. Then it tries to make a shield called 24536.shield. However, only the game itself can spawn things with numerical ids, if you try to you get an error.
So you need to specify a specific id, for example ("snail", level, x, y, facing, "myNewSnail").
If you need to spawn a lot of different snails like that, you can put a counter, and add it to the id: ("snail", level, x, y, facing, "myNewSnail_"..myCounter) and increment the counter at each snail you make.
Well it seems the fxId is incorrect, which is based on the monster id (monster.id..".shield"). So if your monster is named snail_1, the shield particle will be named snail_1.shield.
When you spawn a monster without specifiying an id, for example spawn("snail", level, x, y, facing), it generates a random numerical id, like 24536. Then it tries to make a shield called 24536.shield. However, only the game itself can spawn things with numerical ids, if you try to you get an error.
So you need to specify a specific id, for example ("snail", level, x, y, facing, "myNewSnail").
If you need to spawn a lot of different snails like that, you can put a counter, and add it to the id: ("snail", level, x, y, facing, "myNewSnail_"..myCounter) and increment the counter at each snail you make.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
You could change the script local also, which may be easier (and will fix the script). Change the declaration of fxId to: local fxId = "f_" .. monster.id .. ".shield"
You'll also need to update the declaration of the timerId to: local timerId = "t_" .. monster.id .. ".moveTimer"
I've done this on several other scripts so I don't need to worry about if the monster/item is spawned or placed to get a good id generated.
You'll also need to update the declaration of the timerId to: local timerId = "t_" .. monster.id .. ".moveTimer"
I've done this on several other scripts so I don't need to worry about if the monster/item is spawned or placed to get a good id generated.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Ah right, thanks for the tip!
When I did this shield script I was still novice at scripting, it sure can be rewritten to be a bit more optimized or robust.
When I did this shield script I was still novice at scripting, it sure can be rewritten to be a bit more optimized or robust.