|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 23, 2011 12:14 AM |
|
|
|
bbvsdd
Hired Hero
|
posted February 23, 2011 02:00 AM |
|
|
How would I code the following:
say I want to give this special ability to evil eyes:
Evil eyes have a 10% chance to cast blind on enemy creatures after a ranged attack, REGARDLESS WHETHER THE TARGET IS IMMUNE TO BLIND OR NOT, unless the target is another evil eye or beholder. So black dragons can still be "blinded" by evil eyes but not from other means.
I know how to code it using EA receiver but the difficulty is the "REGARDLESS WHETHER THE TARGET IS IMMUNE TO BLIND OR NOT, unless the target is another evil eye" part.
How can this be coded in ERM in a stand-alone script?
what would need to be changed if we give this ability to a non-shooting creature?
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 23, 2011 03:03 AM |
|
|
|
bbvsdd
Hired Hero
|
posted February 24, 2011 01:25 AM |
|
|
Sorry, should i now go delete the earlier entires?
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 24, 2011 11:07 AM |
|
|
If no answer, means either no one knows, or it is too long to make, or it is not possible, or your "request" was not clearly formulated.
I don't understand very well what you asked. You want the eyes to blind on attack all the creatures, even those which are immunes to magic? Then it requires a longer script, more than a simple EA command.
____________
Era II mods and utilities
|
|
sagamosa
Hired Hero
|
posted February 24, 2011 02:32 PM |
|
|
try using the below simple code which should do the trick.
ZVSE
!?BG0; before stack action
!!BG:A?y-1 N?y-2; what's next action? / stack #
!!BMy-2:T?y-3; active stack monster type?
!!FU&y-3<>74/y-3<>75:E; continue for evil eyes/beholders
!!FU&y-1<>7:E; end code if action is not "shoot"
!!BG:E?y-1; destination stack #
!!BMy-1:M62/1/3; apply blind spell for 1 round on expert fire
magic skill
____________
Sagamosa
[url=http://www.wog.euweb.cz]Advanced Levels[/url]
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 24, 2011 05:50 PM |
|
|
Sagamosa, will work with all spells except blind, because the spell is always applied before hit, being in BG0 trigger therefore the arrow will dispel it. (tricky, no matter the order, ERM still process everything before the arrow leaves )
Try this:
ZVSE
!?BG0; before stack action
!!BG:A?y-1 N?y-2; what's next action? / stack #
!!BMy-2:T?y-3; active stack monster type?
!!FU&y-3<>74/y-3<>75:E; continue for evil eyes/beholders
!!FU&y-1<>7:E;
!!IF:V99/1; enable post shot
!?BG1&99;
!!BG:E?y-1; destination stack #
!!BMy-1:M62/1/3; apply blind spell for 1 round on expert fire
!!VRz10:S^Blind.wav^;
!!SN:Pz10; play sound
!!BMy-1:V6; add blind animation
!!IF:V99/0;
I would also change the spell duration to >1 because almost all creatures immune to blind are faster than the eyes, so practically you will blind them always too late. And of course, bbvsdd, you will have to code the 10% chance in.
____________
Era II mods and utilities
|
|
bbvsdd
Hired Hero
|
posted February 25, 2011 02:15 AM |
|
|
Thanks for the reply.
So I think the random number thing can be used to generate the 10% probability, using !!VRv7000:S0 T99;
ZVSE
!?BG0; before stack action
!!BG:A?y-1 N?y-2; what's next action? / stack #
!!BMy-2:T?y-3; active stack monster type?
!!FU&y-3<>74/y-3<>75:E; continue for evil eyes/beholders
!!FU&y-1<>7:E;
!!IF:V99/1; enable post shot
!?BG1&99;
!!VRv7000:S0 T99; randomly generate v7000 between 0 and 99
!!BG:E?y-1; destination stack #
!!BMy-1&v7000<10:M62/1/3; apply blind spell for 1 round on expert fire if v7000 is less than 10
!!VRz10:S^Blind.wav^;
!!SNz10; play sound
!!BMy-1:V6; add blind animation
!!IF:V99/0;
Would this code fly?
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 25, 2011 08:36 AM |
|
|
[...]
!?BG1&99;
!!VRv7000:S0 T100;
!!IF&v7000>10:V99/0;
!!FU&v7000>10:E; 10% chance
!!BG:E?y-1; destination stack #
!!BMy-1:M62/1/3; apply blind spell for 1 round on expert fire
!!VRz10:S^Blind.wav^;
!!SN:Pz10; play sound
!!BMy-1:V6; add blind animation
!!IF:V99/0;
____________
Era II mods and utilities
|
|
Tryphone
Tavern Dweller
|
posted February 25, 2011 05:36 PM |
|
|
Quote: Change the icons in Artefact.def
Hi Salamandre, and thanks for the good answer
I'm WanderingHero (just recovered my lost account ) and i'm glad to see there's such a way.. but where i can find the artefact.def file? I didn't do such modifications since now, so i'm sorry for not knowing it
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 25, 2011 08:59 PM |
|
|
First you will have to download ERA, the last WoG version, having all modding tools inside. Then open H3sprite.lod with MM archive, extract Artifact.def, open it with Defpreview and extract all frames in some folder. Replace the one you want, repack the whole thing back using DefTool, and put it back in H3sprite.lod.
Sounds long, but once you are used to, it takes a few minutes.
____________
Era II mods and utilities
|
|
bbvsdd
Hired Hero
|
posted February 26, 2011 07:26 AM |
|
|
Salamandre is the best!!!
Your code worksd and WOG didn't crash
So I loaded the following code into WOG for testing purposes, with 100% occurance.
There were a few instances I found the enemy was casted blind but was still able to attack. A particular situation was when an evil eye attacked a marksman and the markman moved immediately after the eye. There was the blind sound and animation being played, the marksman's status shows red (Some negative spell on it) but it still attacked the eye.
Here's the code I used.
!?BG0; before stack action
!!BG:A?y-1 N?y-2; what's next action? / stack #
!!BMy-2:T?y-3; active stack monster type?
!!FU&y-3<>74/y-3<>75:E; continue for evil eyes/beholders
!!FU&y-1<>7:E;
!!IF:V99/1; enable post shot
!?BG1&99;
!!BG:E?y-1; destination stack #
!!BMy-1:M62/1/3; apply blind spell for 1 round on expert fire
!!VRz10:S^Blind.wav^;
!!SNz10; play sound
!!BMy-1:V6; add blind animation
!!IF:V99/0;
Any clue why that was happening? Is it because of the post-shot trigger?
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 26, 2011 07:22 PM |
|
|
I don't know why marksmen move while blinded. Maybe the trigger comes too late. Anyway, it should be fixed with the BG:A12 at the end of the script:
[...]
!!BMy-1:V6;add blind animation
!!BG:A12; disable stack for this turn
!!IF:V99/0;
____________
Era II mods and utilities
|
|
bbvsdd
Hired Hero
|
posted February 26, 2011 08:19 PM |
|
|
Okay that problem is now fixed. so do I use the following code to code the part "evil eyes can't blind another evil eye"?
!?BG1&99;
!!BG:E?y-1; destination stack #
!!BMy-1:T?y-2; what's the target stack #?
!!FU&y-2=74/y-2=75:E; stop if target is evil eyes
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 26, 2011 08:23 PM |
|
|
!?BG1&99;
!!BG:E?y-1; destination stack #
!!BMy-1:T?y-2; what's the target stack #?
!!FU|y-2=74/y-2=75:E; stop if target is evil eyes
| = or -if one of the conditions
& = and - checks for both conditions at once, so yours can't work
____________
Era II mods and utilities
|
|
bbvsdd
Hired Hero
|
posted February 26, 2011 08:25 PM |
|
|
Thank you!
As you can tell, I'm erm - noob
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 26, 2011 08:30 PM |
|
|
|
bbvsdd
Hired Hero
|
posted February 27, 2011 12:33 AM |
|
|
Seems like the above evil-eye code work on most of the original SOD creatures. I have tested a few WOG creatures and it won't work...
I applied the 100%-chance test code for eyes, archers and lizards they worked fine but the blind part doesn't work for WOG creatures like lord of thunder, sorceress and dracolich....
also the code seems to just apply blind when any creature shoot during the first round of combat... why is this happening?
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted February 27, 2011 01:00 AM |
|
|
|
bbvsdd
Hired Hero
|
posted February 27, 2011 01:01 AM |
|
Edited by bbvsdd at 01:04, 27 Feb 2011.
|
... Could you plz copy-pasta the code you have in?
Also did you use a stand-alone erm script or did you code it into a map event? I used a stand-alone script numbered 99.
I am certain I didn't mess up IDs because the same ID was used to add the creature to starting hero.
____________
|
|
|