Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: ERM help and discussion
Thread: ERM help and discussion This Popular Thread is 407 pages long: 1 ... 40 41 42 43 44 ... 50 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Salamandre
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
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?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 12, 2009 06:57 PM
Edited by Salamandre at 19:01, 12 Aug 2009.

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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
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?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 12, 2009 07:12 PM
Edited by Salamandre at 19:17, 12 Aug 2009.

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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted August 12, 2009 07:49 PM
Edited by Warmonger at 19:49, 12 Aug 2009.

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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 12, 2009 08:02 PM
Edited by Salamandre at 20:04, 12 Aug 2009.

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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
pei
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
gnollking
gnollking


Supreme Hero
posted August 16, 2009 07:10 PM
Edited by gnollking at 17:50, 01 Oct 2009.

EDIT: Is there anyway to change 'Beastmaster' to 'Gnoll' for Drakon

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
gnollking
gnollking


Supreme Hero
posted August 22, 2009 05:25 PM
Edited by gnollking at 17:27, 22 Aug 2009.

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?

____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted August 22, 2009 06:33 PM
Edited by Salamandre at 20:28, 22 Aug 2009.

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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
gnollking
gnollking


Supreme Hero
posted August 23, 2009 12:07 PM

Thank you it worked!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
gnollking
gnollking


Supreme Hero
posted August 27, 2009 06:58 PM

How to create ERS from ERM

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 407 pages long: 1 ... 40 41 42 43 44 ... 50 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.3305 seconds