|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 07, 2012 12:50 AM |
|
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 07, 2012 01:07 AM |
|
|
Quote: In this dialog? Just script it. Each pcx inside is an item, clickable.
Ok one more question (hopefully). How would I change the starting hero that the player initially chooses? So if I choose Conflux, say Luna, artifact, then press start, where can I see that Luna was chosen? Will it be HE-1
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 07, 2012 01:17 AM |
|
|
It is hard to give an advice, as I have no idea what you want, replace the regular hero pick with a custom one from dialog?
Here is what I would do:
1) Compile all pcx in defs and create master def with all of them
2) Create cadre in dialog for this def
3) Add arrows left and right to this cadre, when click on, heroes are browsed. Add +1/-1 to some var when heroes are browsed so you can keep track which was selected ie you start with hero x, v10=0, click on arrow right, hero y is shown, v10=1, click back, hero x again, v10=0.
4)the untested part: kill the regular starting hero (loop through that color heroes and kill if found) and replace on same location (in town?) with the one selected. Maybe this last should be in PI section or in first day timer, need test.
____________
Era II mods and utilities
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 07, 2012 01:36 AM |
|
|
Quote: It is hard to give an advice, as I have no idea what you want, replace the regular hero pick with a custom one from dialog?
Here is what I would do:
1) Compile all pcx in defs and create master def with all of them
2) Create cadre in dialog for this def
3) Add arrows left and right to this cadre, when click on, heroes are browsed. Add +1/-1 to some var when heroes are browsed so you can keep track which was selected ie you start with hero x, v10=0, click on arrow right, hero y is shown, v10=1, click back, hero x again, v10=0.
4)the untested part: kill the regular starting hero (loop through that color heroes and kill if found) and replace on same location (in town?) with the one selected. Maybe this last should be in PI section or in first day timer, need test.
I was thinking along those very lines. I'm trying to get DL:A to work now. I tried
!!VRz913:S^thelD.pcx^;
!!DL1:Av999/11/z913;
inside the !?DL trigger but the picture did not change when I clicked it. I'm sure my syntax is wrong, but how?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 07, 2012 01:50 AM |
|
|
You need a trigger.
You should look for dialogs examples. They are in Phoenix mod, probably many in MoP (but very hard to find), and in Empire IV, my last map. I don't know about other maps/mods having DL inside atm.
Again, I would compile all the heroes pcx in one master def, and place cadre 0 in specific emplacement. When click on arrows right/left, def cadres change and show a different hero. It should look exactly as hero pick dialog in regular H3 screen.
Something similar to MoP dialog:
Instead of spell you have a hero def, browse with arrows.
____________
Era II mods and utilities
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 07, 2012 02:10 AM |
|
Edited by Kegolo at 02:13, 07 Mar 2012.
|
Quote: You need a trigger.
Yeah I have one, does this not suffice?
!?DL&v998=1/v999<=16/v1000=13; [any hero button pressed]
!!VRy1=16+v999;
!!DL1:Av999/4/y1;
My def has cadre0 as blank, then cadre 1-16 correspond to hero portraits, 17-32 for "pressed" picture and I want it to look pressed when I click on it, but it doesnt...
and also the ID of each hero portrait corresponds to their number, 1-16
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 07, 2012 02:13 AM |
|
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 07, 2012 02:18 AM |
|
|
Quote: Try v1000=12.
Nope didn't help. I was looking through your script for your new map and you used 4 parameters for DL:A like:
!!DL10:A16/4/v31/1;
!!DL10:A17/4/v32/1;
what's the extra 1 at the end? I tried adding it to mine but still nothing sadly
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 07, 2012 02:22 AM |
|
|
Some old beliefs, kinda black magic, affirm that the extra 1 parameter when inside a function, will prevent crash. Sagamosa uses it, Berserker uses it, JimV uses it, I parrot the masters. A few tests with and without show crash increased rate. As you don't use function (maybe should?), there is no need to add it.
Add test messages to your script:
!?DL&v998=1/v999<=16/v1000=13; [any hero button pressed]
!!IF:M^%V999^;
!!VRy1=16+v999;
!!IF:M^%Y1^;
!!DL1:Av999/4/y1;
!!IF:M^%V999, %Y1^;
And compare results.
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted March 07, 2012 02:32 AM |
|
|
My two cents: I don't recognize this command:
!!VRy1=16+v999;
Maybe it is new in Era. I think it would give a syntax error in WoG 3.58f.
!!VRy1:S16+v999; would be the WoG 3.58f syntax.
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 07, 2012 05:21 AM |
|
|
Quote: My two cents: I don't recognize this command:
!!VRy1=16+v999;
Maybe it is new in Era. I think it would give a syntax error in WoG 3.58f.
!!VRy1:S16+v999; would be the WoG 3.58f syntax.
Sorry it was a typo, not the issue. New Question: is there a way to check what options the player chose in the hero select screen? If they chose artifact I need to not only kill the hero but take that artifact and give it to the new one, but not sure how...
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 07, 2012 06:28 AM |
|
|
Quote:
Quote: My two cents: I don't recognize this command:
!!VRy1=16+v999;
Maybe it is new in Era. I think it would give a syntax error in WoG 3.58f.
!!VRy1:S16+v999; would be the WoG 3.58f syntax.
nvm I think what I am attempting is impossible. I can't see any way of getting what "team" a player is by their choice from the menu screen, nor is there a way to add a hero mid game. It was all for not sadly :(
|
|
Bersy
Honorable
Supreme Hero
|
posted March 07, 2012 02:08 PM |
|
|
Quote: As you don't use function (maybe should?), there is no need to add it.
Always use 4 parameters.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 07, 2012 02:13 PM |
|
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 07, 2012 05:34 PM |
|
|
Quote:
Quote: As you don't use function (maybe should?), there is no need to add it.
Always use 4 parameters.
So on a new topic, is there a way to get/check the player's 3 starting choices, ie town, hero, and starting bonus? Preferably with !# so I can change it before the map starts?
|
|
solitaire345
Promising
Famous Hero
|
posted March 07, 2012 06:47 PM |
|
|
Quote: Always use 4 parameters.
Added a note about this to ERM help.. Fourth parameter is something about refreshing the dialog. I guess the dialog item gets reallocated and some pointer is left unupdated.
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 08, 2012 02:02 AM |
|
|
kegolo, I don't know such thing. It is possible to get town faction, starting hero by ERM before map loads, but what if player chooses random? If you change it, it is no more random. It is also possible to know if he chooses resource, by comparing results after you get difficulty. For artefacts, it may be more complicate.
____________
Era II mods and utilities
|
|
Kegolo
Promising
Famous Hero
of infamy
|
posted March 08, 2012 05:22 AM |
|
|
Quote: kegolo, I don't know such thing. It is possible to get town faction, starting hero by ERM before map loads, but what if player chooses random? If you change it, it is no more random. It is also possible to know if he chooses resource, by comparing results after you get difficulty. For artefacts, it may be more complicate.
Salamandre I just wanted to say thanks for all the help. Dialogue box is working 100% for multiplayer for both human and computer. Code was relatively simple after all, this takes care of all of it:
!?DL&v998=100/v999<=16/v999>=1/v1000=13; [any hero button pressed]
!!DL:C1000;
!!VRv952:Sv999+127; [make appropriate number the hero clicked]
!!OW:C?y1; [current player]
!!HEv952?y6;
!!IF&y6<>-1/y6<>y1:M^Sorry, this {Hero} is already in the game^;
!!FU&y6<>-1/y6<>y1:E;
!!OWy1/0/?y2; [current player's active hero]
!!HEy2?y3/?y4/?y5; [hero's x y level]
!!HEy2:K; [kill current hero there]
!!HEv952y3/y4/y5; [bring clicked hero onto original space]
!!HEv952y1; [set owner]
!!OW:A-1/v952; [set active]
!!DO1340/7/170/1y2/v952;[check for artifacts]
!!DL:C1; [close dialogue]
!?FU1340; [give starting artifact to new hero]
!!HEx1:A2/x16/?y1/?y2; [y1 number of artifacts this hero has]
!!HEx2&y1<>0:A1/x16/19; [equip in backpack]
Only thing that doesn't work is the DL:C1000 command, but oh well
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 09, 2012 05:52 PM |
|
|
I need big help with Fnord's training facility script. As it is, if player has 7 stacks at 0 experience, it requires 70 clicks to raise everyone to ACE. I wonder if, in the actual form, an additional option could be added, "upgrade all to next rank", so it decrease to 7 max clicks if enough gold. I am afraid I don't see how to modify it, other that starting from scratch. If someone has any idea about, I take it!
!?CM2&v2=600/v3=0;
!!FU509:P;
!?FU509;
!!DO507/0/6/1:P; [Build text strings for dialogue box]
!!OW:R-1/6/?y1;
!!VRz-1:S^Select a stack to train to the next rank. Available gold: %Y1^;
!!VRz-2:S^I'll do it later.^;
!!IF:G1/1/128/-1/1/2/3/4/5/6/7/-2/0/0/0/0; [Display dialogue box]
!!FU&v1=128:E; [Exit if player chose to come back later]
!!VRy-10&v1=1:S0; [Stack 0 selected: y-10]
!!VRy-10&v1=2:S1; [Stack 1 selected: y-10]
!!VRy-10&v1=4:S2; [Stack 2 selected: y-10]
!!VRy-10&v1=8:S3; [Stack 3 selected: y-10]
!!VRy-10&v1=16:S4; [Stack 4 selected: y-10]
!!VRy-10&v1=32:S5; [Stack 5 selected: y-10]
!!VRy-10&v1=64:S6; [Stack 6 selected: y-10]
!!HE-1:C0/y-10/?v2/?v3/?v4/2; [v2=type, v3=number, v4=exp]
!!UN&v3=1:N3/8/v2/0; [Monster name (singular): z8]
!!UN&v3>1:N3/8/v2/1; [Monster name (plural): z8]
!!MA:Lv2/?y-6; [Monster level (0..6): y-6]
!!VRy-6:+1; [Add 1 to monster level: y-6]
!!FU508:Py-6/v4/v2; [Get rank: y-20]
!!VRy-5:Sy-20 +1; [Next rank to train creatures to: y-5]
!!VRy-7:Sy-6; [Copy of monster level: y-7]
!!VRy-9:Sv2 :2 *2; [Check if monster is upgraded: y-9]
!!VRy-7&y-9<>v2/v2<=131:+1; [Add 1 more level if monster is upgraded: y-7]
!!VRy-7&v2>=150/v2<=158:+2; [Add 2 more if monster is level 8: y-7]
!!VRy-8:Sv3 *y-5 *y-6 *y-7:2; [Calculate cost: y-8]
!!VRy-8&v1975=4::2; halve cost for estates specialists
!!OW:R-1/6/?y-11; [Player's gold: y-11]
!!IF&y-11<y-8:Q1/6/y-8/1^Not enough gold!^;
!!FU&y-11<y-8:E; [Exit if player doesn't have enough gold]
!!IF:Q1/21/v2/6/y-8/17/y-5/1^DONE!^;
!!VRy-13:Sy-11 -y-8; [Player's new gold: y-13]
!!OW:R-1/6/y-13; [Set player's new gold: y-13]
[Set new rank for troops: y-5=new rank]
!!HE-1:C0/y-10/d/d/y-5/12;
!!UN:R3/-1;
!!FU509:P;
[Build text strings for dialogue box]
!?FU507;
!!HE-1:C0/x16/?y1/?y2/?y3/2; [y1=type, y2=number, y3=experience]
!!VRy4:Sx16 +1; [Index for z variable to store text strings (z1..z7)]
!!VRzy4:S^^; [Initialize z variables to empty strings]
!!FU|y1<0/y2<1:E; [Skip if no monster in this slot]
!!UN&y2=1:N3/8/y1/0; [Monster name (singular): z8]
!!UN&y2>1:N3/8/y1/1; [Monster name (plural): z8]
!!MA:Ly1/?y6; [Monster level (0..6): y6]
!!VRy6:+1; [Add 1 to monster level: y6]
!!FU508:Py6/y3/y1; [Get rank: y-20]
!!VRy5:Sy-20 +1; [Next rank to train creatures to: y5]
!!FU&y5>10:E; [Skip if stack is already at rank 10]
!!VRy7:Sy6; [Copy of monster level: y7]
!!VRy9:Sy1 :2 *2; [Check if monster is upgraded: y9]
!!VRy7&y9<>y1/y1<=131:+1; [Add 1 more to monster level if upgraded: y7]
!!VRy7&y1>=150/y1<=158:+2; [Add 2 more if monster is level 8: y7]
!!VRy8:Sy2 *y5 *y6 *y7:2; [Calculate cost: y8]
!!VRy8&v1975=4::2; estates specialists
!!VRzy4:S^Train %Y2 %Z8 to Rank %Y5 for %Y8 gold.^;
[Get rank of stack: y-20]
[x1=monster level (1..7), x2=current experience, x3=monster number]
!?FU508;
!!VRe1:S2 :5 +8; [e1=8.4]
!!VRy1:Sx2 :x1; [Base experience for level 1..7 creatures: y1]
!!VRy1&x3>=150/x3<=163:Sx2 :e1; [Base exp. for level 8 creatures: y1]
!!VRy-20&y1<1000:S0; [Rank 0]
!!VRy-20&y1>=1000/y1<2000:S1; [Rank 1]
!!VRy-20&y1>=2000/y1<3200:S2; [Rank 2]
!!VRy-20&y1>=3200/y1<4600:S3; [Rank 3]
!!VRy-20&y1>=4600/y1<6200:S4; [Rank 4]
!!VRy-20&y1>=6200/y1<8000:S5; [Rank 5]
!!VRy-20&y1>=8000/y1<10000:S6; [Rank 6]
!!VRy-20&y1>=10000/y1<12200:S7; [Rank 7]
!!VRy-20&y1>=12200/y1<14700:S8; [Rank 8]
!!VRy-20&y1>=14700/y1<17500:S9; [Rank 9]
!!VRy-20&y1>=17500:S10; [Rank 10]
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted March 09, 2012 06:54 PM |
|
Edited by JimV at 06:49, 11 Mar 2012.
|
Chances are only about 4% that this will work as I just finished typing it and have not tested it, but I have to go play tennis in ten minutes and haven't had time to change yet, so here goes nothing:
ZVSE
* addition uses v300-v307 for temporary use, and FU510 JHV
!?CM2&v2=600/v3=0;
!!FU509:P;
!?FU509;
!!VRv300:C-1/-1/-1/-1/-1/-1/-1/0; JHV
!!DO507/0/6/1:P300; [Build text strings for dialogue box]
!!OW:R-1/6/?y1;
!!VRz-1:S^Select a stack to train to the next rank. Available gold: %Y1^;
!!VRz-2:S^I'll do it later.^;
!!VRz8:S^Train all the above for %V307 gold.^; JHV
!!VRz8&v307<1:S^^; JHV
!!IF:G1/1/128/-1/1/2/3/4/5/6/7/8/-2/0/0/0; [Display dialogue box] JHV
!!FU&v1=256:E; [Exit if player chose to come back later] JHV
!!VRy-10&v1=1:S0; [Stack 0 selected: y-10]
!!VRy-10&v1=2:S1; [Stack 1 selected: y-10]
!!VRy-10&v1=4:S2; [Stack 2 selected: y-10]
!!VRy-10&v1=8:S3; [Stack 3 selected: y-10]
!!VRy-10&v1=16:S4; [Stack 4 selected: y-10]
!!VRy-10&v1=32:S5; [Stack 5 selected: y-10]
!!VRy-10&v1=64:S6; [Stack 6 selected: y-10]
!!IF&v1=128/y1<v307:Q1/6/y-8/1^Not enough gold!^;
!!DO510/y-10/y-10/1&v1<>128:P300; JHV
!!DO510/0/6/1&v1=128/y1>=v307:P300; JHV
!!UN:R3/-1;
!!FU509:P;
!?FU510; x16=troop slot
!!VRy1:Sx1+x16; index to prices JHV
!!VRy-8:Svy1; get price for troop x16 JHV
!!FU&y-8<0:E; exit if priceless JHV
!!HE-1:C0/x16/?v2/?v3/?v4/2; [v2=type, v3=number, v4=exp]
!!UN&v3=1:N3/8/v2/0; [Monster name (singular): z8]
!!UN&v3>1:N3/8/v2/1; [Monster name (plural): z8]
!!MA:Lv2/?y-6; [Monster level (0..6): y-6]
!!VRy-6:+1; [Add 1 to monster level: y-6]
!!FU508:Py-6/v4/v2; [Get rank: y-20]
!!VRy-5:Sy-20 +1; [Next rank to train creatures to: y-5]
!!VRy-7:Sy-6; [Copy of monster level: y-7]
!!VRy-9:Sv2 :2 *2; [Check if monster is upgraded: y-9]
!!VRy-7&y-9<>v2/v2<=131:+1; [Add 1 more level if monster is upgraded: y-7]
!!VRy-7&v2>=150/v2<=158:+2; [Add 2 more if monster is level 8: y-7]
*!VRy-8:Sv3 *y-5 *y-6 *y-7:2; [Calculate cost: y-8] JHV
*!VRy-8&v1975=4::2; halve cost for estates specialists JHV
!!OW:R-1/6/?y-11; [Player's gold: y-11]
!!IF&y-11<y-8:Q1/6/y-8/1^Not enough gold!^;
!!FU&y-11<y-8:E; [Exit if player doesn't have enough gold]
!!IF:Q1/21/v2/6/y-8/17/y-5/1^DONE!^;
!!VRy-13:Sy-11 -y-8; [Player's new gold: y-13]
!!OW:R-1/6/y-13; [Set player's new gold: y-13]
[Set new rank for troops: y-5=new rank]
!!HE-1:C0/x16/d/d/y-5/12;
[Build text strings for dialogue box]
!?FU507; x1=start of price table, price-->v[x1+x16], sum of prices-->v[x1+7]
!!HE-1:C0/x16/?y1/?y2/?y3/2; [y1=type, y2=number, y3=experience]
!!VRy4:Sx16 +1; [Index for z variable to store text strings (z1..z7)]
!!VRzy4:S^^; [Initialize z variables to empty strings]
!!FU|y1<0/y2<1:E; [Skip if no monster in this slot]
!!UN&y2=1:N3/8/y1/0; [Monster name (singular): z8]
!!UN&y2>1:N3/8/y1/1; [Monster name (plural): z8]
!!MA:Ly1/?y6; [Monster level (0..6): y6]
!!VRy6:+1; [Add 1 to monster level: y6]
!!FU508:Py6/y3/y1; [Get rank: y-20]
!!VRy5:Sy-20 +1; [Next rank to train creatures to: y5]
!!FU&y5>10:E; [Skip if stack is already at rank 10]
!!VRy7:Sy6; [Copy of monster level: y7]
!!VRy9:Sy1 :2 *2; [Check if monster is upgraded: y9]
!!VRy7&y9<>y1/y1<=131:+1; [Add 1 more to monster level if upgraded: y7]
!!VRy7&y1>=150/y1<=158:+2; [Add 2 more if monster is level 8: y7]
!!VRy8:Sy2 *y5 *y6 *y7:2; [Calculate cost: y8]
!!VRy8&v1975=4::2; estates specialists
!!VRzy4:S^Train %Y2 %Z8 to Rank %Y5 for %Y8 gold.^;
!!VRy9:Sx1+x16; index to price table JHV
!!VRvy9:Sy8; JHV
!!VRy10:Sx1+7; index to total price JHV
!!VRvy10:+y8; JHV
[Get rank of stack: y-20]
[x1=monster level (1..7), x2=current experience, x3=monster number]
!?FU508;
!!VRe1:S2 :5 +8; [e1=8.4]
!!VRy1:Sx2 :x1; [Base experience for level 1..7 creatures: y1]
!!VRy1&x3>=150/x3<=163:Sx2 :e1; [Base exp. for level 8 creatures: y1]
!!VRy-20&y1<1000:S0; [Rank 0]
!!VRy-20&y1>=1000/y1<2000:S1; [Rank 1]
!!VRy-20&y1>=2000/y1<3200:S2; [Rank 2]
!!VRy-20&y1>=3200/y1<4600:S3; [Rank 3]
!!VRy-20&y1>=4600/y1<6200:S4; [Rank 4]
!!VRy-20&y1>=6200/y1<8000:S5; [Rank 5]
!!VRy-20&y1>=8000/y1<10000:S6; [Rank 6]
!!VRy-20&y1>=10000/y1<12200:S7; [Rank 7]
!!VRy-20&y1>=12200/y1<14700:S8; [Rank 8]
!!VRy-20&y1>=14700/y1<17500:S9; [Rank 9]
!!VRy-20&y1>=17500:S10; [Rank 10]
My additions have "JHV" at the end of their lines. I will test this and find errors in a few hours when I get back.
|
|
|