|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 12, 2009 02:16 PM |
|
|
I could because there is always a longer code which does not use the operators, by enumerating one by one the variables to exclude.
____________
Era II mods and utilities
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 12, 2009 04:50 PM |
|
|
Quote: % here returns the remainder left from integer division. 2/2 = 1 with remainder 0, 3/2 = 1, remainder 1 etc. Quite simply even numbers are these which have remainder from division by 2 equal to zero and odd have it equal to 1.
Ok, my problem was a translation one. Now that I got what an integer (integrer in french means add) means I still don't see how 3/2 = 1. In fact, it gives 1.5 and it is not an integer, because it has a decimal component. This is what you mean?
When the remainder is not an integer, it is always considered as "1"?
____________
Era II mods and utilities
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted August 12, 2009 05:01 PM |
|
|
If you divide integer by integer, the result is also an integer. However as 3/2 is not equal to 1, we have remainder equal to 1. 3 = 2*1 + 1, right?
17/3 = 5, remainder 2 as 5*3 + 2 = 17
18/3 = 6, remainder 0 as 6*3 = 18
19/3 = 6, remainder 1 as 6*3 + 1 = 19 etc.
So % operator always gives us the remainder and ignores the rest.
As even numbers are always equal to 2n, their remainder is always equal to 0.
So you're programmer who don't know maths and I'm a musican who can't play any instrument. How about exchange?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 12, 2009 05:14 PM |
|
|
Quote:
So you're programmer who don't know maths and I'm a musican who can't play any instrument. How about exchange?
ERM does not require any operators to function. So it can be done also by a noob like me, but it takes longer. I always used basic maths inside, and avoiding operators is easy. I was only curious.
I will exchange everything, except my soprano girlfriend
____________
Era II mods and utilities
|
|
pei
Famous Hero
Fresh Air.
|
posted August 12, 2009 06:42 PM |
|
|
Ok, my idea is this: Quests are normal quests, not programmed by me but set up in editor.
Example: Bring seer 50 mercury.
At the exact time where a hero completes the mission, i want a pop up screen (or dialog as you wish to call it) to appear to the current hero explaining the consequences of his act. (with the mercury, the seer will curse blue player´s hero. the most powerfull one i.e.).
Example: Red player´s hero gave the seer 50 mercury. Then, the window appears.
Red player passes his turn.
Now it´s Blue player´s turn. A window appears to the blue player explaining how the consequences of Red player´s quest affects him.
Sorry if i have no code but i dont know if it´s possible this way or if it´s convinient to program the quest so as to have more control over it. Besides, i cant understand how to capture the event of the completed quest yet.
If im still being too evasive then please point me in the right direction.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 12, 2009 06:57 PM |
|
|
Is the blue player also human, or AI? Because the code needs to be slightly modified if he is AI. (different flag and no need of message box, he can't read).
If it is human, it is easy. The seer should enable a flag to true once the 50 mercury were payed, then a time trigger should be enabled by this flag, affecting blue player.
Example:
!#IF:V12/0; **blue spank is not enable
!#IF:V13/0; **seer can be visited
!?OBx/y/z&-13; **seer hut, need to be a wog blank object
!!OW:R0/1/?v123; **check if red player has 50 mercury
!!IF&v123<50:M^Go pee, you drunk snow, I need 50 mercury!^;
!!FU&v123<50:E;
!!IF&v123>=50:M^Thank you, blue player will be hard spanked!^;
!!OW:R0/1/d-50; remove mercury
!!IF:V12/1; **enable flag if mercury was payed
!!IF:V13/1; **disable for further visits
!#TM11:S1/999/1/2; **TM enabled for blue player
!?TM11&12; **will be enabled only if red player completed the quest
!!IF:M^Red player just sent you a present, but it costs you your clothes^;
!!OW:R1/1/d-50; **blue player lose 50 mercury
!!IF:V12/0; **reset flag so the tm stops
There are other ways for sure, this is only one of them.
____________
Era II mods and utilities
|
|
pei
Famous Hero
Fresh Air.
|
posted August 12, 2009 07:08 PM |
|
|
Ok!Will try!
What if i want the blue player to be either human or AI?Can i work around that with an IF clause?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 12, 2009 07:12 PM |
|
|
Then you will not need to bring a message, as AI does not need it. He will be cursed, AI or human. In my example I removed 50 mercury from blue as a punishment because I did not know what you want. Removing resources can be tricky, as if blue does not have >50 mercury, the value will go into negative, with unknown results.
If you want to curse his best hero, you need to loop through all blue heros and choose the one with the highest level, then use ERM "curse/bless" on him. I am not sure on how to find the best hero, needs testing and creativity.
____________
Era II mods and utilities
|
|
pei
Famous Hero
Fresh Air.
|
posted August 12, 2009 07:25 PM |
|
|
To be exactly precise, i will post the pseudo - code :
NOTE: im aiming to create erm codes that can work on AI and human as its a 3vs3 map where each player can be AI or human.
On Red player´s turn
Red player goes to an object that asks him 50 mercury.
IF (red player completes mission by giving 50 mercury )
Then
IF(red player is human)
Then
Display window. Take 50 mercury.
ELSE IF(red player is IA)
Then
Take 50 mercury.
END IF
END IF
On Blue player´s turn
At the start of the turn.
IF (red player has completed mission by giving 50 mercury )
Then
IF(blue player is human)
Then
Display window. Give curse.
ELSE IF(blue player is IA)
Then
Give curse.
END IF
END IF
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 12, 2009 07:32 PM |
|
|
My code will do the work, minus the curse part. Which hero has to be cursed, thats the problem. And if red is AI, why the hell will him visit the seer and lose 50 mercury?
As for creating codes which work for AI/human I can't help much. Only Fnord created a MP map, "Choices" and it required billions of additional codes for every simple action. Mostly because you have to check at each action if player is AI or human and set flag 1000 to false or true.
If I were you, I would aim for a single human vs AI map. Otherwise you will drop into untested land.
____________
Era II mods and utilities
|
|
pei
Famous Hero
Fresh Air.
|
posted August 12, 2009 07:46 PM |
|
|
Untested is my second name... i will try...if i fail i can reach the same goal through another angle...i think jaja
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted August 12, 2009 07:49 PM |
|
|
Quote: Mostly because you have to check at each action if player is AI or human and set flag 1000 to false or true.
As far as I know, ERM allows functions? I don't know possibilities of this language but at least instead of writting several lines in very command, you just have to call function and it will set the flag. Pass the text of message as its parameter and you will have it displayed under desired conditions.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 12, 2009 08:02 PM |
|
|
Yes. But this requires additional coding for each action. Pei wants to have a message if the player is human, but not have the same message if the player is AI. It is quite long to be done for each object on the map. Not mentioning that AI will NEVER do exactly what you are asking to him, move, battle, flee. He wants to control everything. IT took me 6 months of testing to control 56 AI heros on 300 and avoid any flaw. It is possible, but needs a lot of tests.
How do you tell the AI to visit an object? If he has other priorities, he will not visit it. You can order him on a specific day to move towards the object, but if something blocks the path he will freeze. How do we know in a MP map where is exactly AI on day xx, so we can control it? Hard to say.
____________
Era II mods and utilities
|
|
pei
Famous Hero
Fresh Air.
|
posted August 12, 2009 08:13 PM |
|
|
Dont really know for now...but i will come up with an alternative if an AI player visits the object. Or perhaps i change my mind...dont know it right now but it´s all organic I´ll let u know if everything blows up
|
|
gnollking
Supreme Hero
|
posted August 16, 2009 07:10 PM |
|
|
EDIT: Is there anyway to change 'Beastmaster' to 'Gnoll' for Drakon
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 22, 2009 04:34 PM |
|
|
Yes you can script a dwelling to sell shamans, but you need to set:
How much a shaman costs?
How many are available each week?
As for changing Beastmaster class to "Gnoll" for a single hero I don't see any way. You can change the name of a class when editing txt. files but it will affect all heros of that class.
____________
Era II mods and utilities
|
|
gnollking
Supreme Hero
|
posted August 22, 2009 05:25 PM |
|
|
The original cost of shamans is 140 gold and their growth is 9. I don't know how to make the dwelling so please someone help me..
Btw, can i change the name of the class for all beastmasters then? With ERM?
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted August 22, 2009 06:33 PM |
|
|
1)Place any creature dwelling at 10/10/0 coordinates then run this script. You can change the coordinates if need.
ZVSE
!#VRz222:S^Shaman house^;
!#OB10/10/0:H222; [Set hint text]
!#MA:C190/6/140; **Shamans cost
!#TM1:S1/999/7/1;
[Weekly Timer for red player]
!?TM1;
!!DW10/10/0:M0/190/9; [place 9 Shamans]
!?OB10/10/0;
!!IF&1000:Q2/21/190/2^{Shaman house}
Would you like to recruit
Shamans?^;
!!OB10/10/0:M-1/1/0; [Cancel normal message]
Not tested but should work for red player.
2)I can't do it and don't think it is possible.
____________
Era II mods and utilities
|
|
gnollking
Supreme Hero
|
posted August 23, 2009 12:07 PM |
|
|
Thank you it worked!
|
|
gnollking
Supreme Hero
|
posted August 27, 2009 06:58 PM |
|
|
How to create ERS from ERM
|
|
|