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 50 100 150 ... 191 192 193 194 195 ... 200 250 300 350 400 407 · «PREV / NEXT»
JimV
JimV


Responsible
Supreme Hero
posted March 07, 2013 09:42 PM

Quote:
I have no why !!TRx1/x16/x6:Vx2; [open map], which opens squares visibility for player ID=x2 closes it for other players.


If x2 applies to a single "player ID", then it must remove the visibility for other players. If it applies to a set of players (but not all), it still must remove visibility for "other players". In other words, there should be no other players besides those accounted for in x2 (either with zero bit-flags or 1 bit-flags - in binary, e.g. 00001011 binary = 11 decimal is binary for Red, Blue, and Orange visible).

That is not what your followup post shows, but it is all I had to go on at the time. Now I see your actual problem:

!!TRx1/x16/x6:V?n; [get visibility bit]
!!VRn:&x2; [check current player bits] <-- n has been replaced!
!!FU&n=x2:E; [if already visible, exit]
!!VRn:+x2; [add player bit to not visible square] <-- so you are adding x2 to n&x2, not to the original n
!!TRx1/x16/x6:Vn; [set new bit]

I think it should be:

!!TRx1/x16/x6:V?n; [get visibility bit]
!!VRn:|x2; put in x2 bit-flags without removing others
!!TRx1/x16/x6:Vn; [set new bit] [if it wasn't already set, if it was so what?]

Still, not bad for five minutes work on your part.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 07, 2013 10:12 PM
Edited by Salamandre at 22:16, 07 Mar 2013.

Ahh of course, I missed add bit (|), damnt.  Next time I should be more careful, it works now, thanks.


@Artu, cartographer.erm
____________
Era II mods and utilities

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


Promising
Undefeatable Hero
My BS sensor is tingling again
posted March 08, 2013 05:58 AM

Test results:

It now resets weekly but I guess that's intentional. However the extra reset that we have on day two (of same player, no hot seat mistake) is still there, this time on a weekly basis.

Sorry guys, I thought this would be a 4-5 liner simple script. I had no idea it was gonna turn into such a headache.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 08, 2013 06:28 AM
Edited by Salamandre at 08:06, 08 Mar 2013.

Meh, modify the timer, the test one was set to 7 days, I won't click 56 times for the same result.

For second day glitch it was my fault. I fixed the second part of timer to work only on first human player turn, so objects don't get reset again on second player turn. This glitch is also present in TDS, timer reseting PO runs on all players turn, therefore the emerald tower can be visited again on second day, but I never complained ;)

Cartographer.erm

!#TM91:S1/999/7/255; [timer 91, every 7 days, all players, change value of reset (7 days)]
!#IF:V149/0; set flag for first human player

!?TM91;
!!OW:C?y-2; [get current player]
!!OW:Iy-2/?y-3;  [get if AI or human]
!!FU&y-3<>0:E;  [exit if AI]
!!SN&-149:W^first player^/y-2; [store first human player]
!!VRy1:Sc; [get day]
;run first day
!!if&y1=1:; [only first day]
!!UN:U13/-1/?y-1; [get cartographers number]
!!VRv1:S-1;
!!DO567890/1/y-1/1:P13/y-2;  [run through each one]
!!IF:V149/1; [don't store second human player, if any]
!!en:;
;run from day 7
!!if&y1>1:; [starting with 7th day]
!!OW:C?y2;
!!SN:W^first player^/?y3; [check for first human player]
!!FU&y2<>y3:E; [exit if not first human player so reset does not run again on next H player/day 1 of the week]
!!UN:U13/-1/?y-1; [get cartographers number]
!!VRv1:S-1;
!!DO567891/1/y-1/1:P13;  [run through each one]
!!en:;

Don't be sorry, I choose to work on because it was a challenge.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 09, 2013 04:39 PM

In emerald tower script it says this command converts player number to player bits:

!!OW:C?v2;
!!VRv2:+550;
!!VRv2:Svv2;

But %V2 returns garbage. How it works?!
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted March 09, 2013 05:44 PM
Edited by JimV at 17:52, 09 Mar 2013.

It uses a table of bit-values versus bit-numbers (bit 0 is 1, bit 1 is 2, etc.) which I think is built into script00.erm. It would look something like this:

!#VRv550:C1/2/4/8/16/32/64/128; for player numbers 0-7

The table is probably longer than that for higher bit-numbers, but at least that much is necessary to convert player numbers.

Once it has been created by any script, it can be used by all WoG scripts without each script re-creating it, but a standalone script which uses it needs the above instruction. This instruction will be redundant if script00.erm (or the Era version) has been loaded, but will not conflict.

Edit - actually, the table is in the Emerald Tower Script itself (script44.erm):

 [Bit table, also in Adventure Cave, Map Rules and Monster Mutterings]
!#VRv550&v1=1:C1/2/4/8/16/32/64/128/256/512;

And for some reason it is only created if script 44 (P44) is enabled. Since the variables must be reserved anyway, I would have created it regardless, so it could always be used by any other WoG script.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 09, 2013 06:16 PM

Thanks, I missed the instruction.
____________
Era II mods and utilities

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


Known Hero
Editing Heroes Without Limits
posted March 09, 2013 08:34 PM

I used !!UN:I3/3/0/100/0;
      !!UN:I5/5/0/100/0;

Placing two learning stones. When my hero visit one of them the other one became visited too, besides I didnīt visited it yet. How do I fix this?

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


Responsible
Supreme Hero
posted March 09, 2013 09:30 PM
Edited by JimV at 21:32, 09 Mar 2013.

At the end of the UN commands, ERM Help says this:

--------start ERM Help Quote-----------------------
Placing Objects (with I option):
These objects should work correctly without additional set up. Many may be customized with a specific object receiver if desired.

Artifacts (type=5, subtype=0-143) - Receiver: !!AR
Boats (type=8, subtype=0-2)
Creature Generators (type=17, subtype=0-88 and 20, subtype=?) - Receiver: !!DW
Garrison (type=33, subtype=0 for standard, =1 for anti-magic) - Receiver: !!GR
Grail (type=36, subtype=0) (This is the buried Grail.) There may be only one Grail on the map at one time, so placing the Grail with ERM will eliminate one placed in the Map Editor (gold bubble) or placed automatically by the Heroes program due to having Obelisks on the map. Once a Grail has been dug up, resetting all the Obelisks to unvisited and placing another Grail object will allow a second Grail to be dug, et cetera.
Lighthouse (type=42, subtype=0-7 for player colours or -1 for neutral)  - Receiver: !!MN (same as for mines)
Marletto Tower (type=23, subtype=0)
Monolith Two Way (type=45, subtype=0-7)
Mine (type=53, subtype=0-7) - Receiver: !!MN
Monster (type=54, subtype=0-144) - Receiver: !!MO
Ocean Bottle (type=59, subtype=0) - Receiver: !!SG (same as for signs)
Redwood Observatory (type=58, subtype=0)
Resource (type=79, subtype=0-6) - Receiver: !!AR (same as for artifacts)
Sanctuary (type=80, subtype=0)
Shipyard (type=87, subtype=0-7 for player colours or -1 for neutral)  - Receiver: !!SY
Sign (type=91, subtype=0) - Receiver: !!SG
Spell Scroll (type=93, subtype=0-69) - Receiver: !!AR
Town (type=98, subtype=0-8) - Receiver: !!CA
University (type=104, subtype=0) - Receiver: !!UR
Witch Hut (type=113, subtype=0-27) - Receiver: !!WH

These objects will probably need additional set up with their specific object receiver to work correctly:

Campfire (type=12, subtype=0) - Receiver: !!FR
Corpse (skeleton) (type=22, subtype=0) - Receiver: !!SK
Event (type=25, subtype=0) - Receiver: !!LE - if placed with I option, this event will initially be set as enabled to all players and will not be cancelled after the first visit.
Lean To (type=39, subtype=0) - Receiver: !!LN
Learning Stone (type=100, subtype=0) - Receiver: !!ST
Magic Shrine (type=88,89,90, subtype=0) - Receiver: !!SR
Magic Spring (type=48, subtype=0) - Receiver: !!SP
Mystical Garden (type=55, subtype=0) - Receiver: !!GD
Obelisk (type=57, subtype=0) - Receiver: !!MT
Pyramid (type=63, subtype=0)  - Receiver: !!PM
Scholar (type=81, subtype=0) - Receiver: !!SC
Swan Pond (type=14, subtype=0) - Receiver: !!SW
Treasure Chest (type=101, subtype=0) - Receiver: !!CH
Tree of Knowledge (type=102, subtype=0) - Receiver: !!KT
Wagon (type=105, subtype=0) - Receiver: !!WG
Warrior's Tomb (type=108, subtype=0) - Receiver: !!WT
Water Wheel (type=109, subtype=0) - Receiver: !!WM
Windmill (type=112, subtype=0) - Receiver: !!ML

These objects will NOT work properly and may possibly cause game instabilities, map crashes or other problems if placed:

Pandora's Box (type=6)
Hero (type=34) - (use the HE:P command to place a hero on the map instead)
Prison (type=62)
Seer's Hut (type=83)
Quest Guard (type=215)

Other Objects
Some other objects not listed above (aside from rocks, trees, etc.) may need to be set up with the generic object command; you can try changing their control number so as not to duplicate an existing object of the same type, but this is by no means guaranteed to work. Also, some objects not listed may actually work fine with no set up required--but they have not been tested yet. Proceed at your own risk.
---------end ERM Help quote------------------------

Under Other Objects, ERM Help says:

--------start ERM Help Quote-----------------------
!!ST#1/#2/#3: Learning Stone at x,y,l coordinates
(Learning Stones are Type 100)

  N$ - Number of the Learning Stone (0...31)
---------end ERM Help quote------------------------

When two Learning Stones have the same number, visiting one is the same as visiting both. You will need to count the number of Learning Stones you have (can be done in a script with UN:U), and give the new ones different numbers - as long as you don't have more than 32 Learning Stones on the map, which is the maximum allowed.

(Some day I will be gone and people will have to read all of ERM Help for themselves.)


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


Admirable
Omnipresent Hero
Wog refugee
posted March 12, 2013 01:12 AM
Edited by Salamandre at 02:35, 12 Mar 2013.

I don't know how to solve the following issue:

Hero can have up to 5 scrolls of blind equipped. Every time he casts blind, one scroll is removed. When the last is removed, blind spell is removed from book.

!!BG:A?y2;
!!if&y2=1/v1975=3:; [for masters of elements]
!!FU&y3>31:E; [exit if not our hero, ID 0-31]
!!BG:S?v1; v1 now contains spell number
!!FU&v1<>62:E; [exit if not blind]
!!HEy3:A3/1063/1/1; [delete one scroll equipped (flag 1)]
!!HEy3:A2/1063/?y-11/?y-12; [check if hero has still a scroll of blind equipped]
!!FU&y-12>0:E; [exit if still one or more]
!!HEy3:M62/0; [remove blind from book if no scrolls]
!!en:;

I tried both HE:A-1063 but it removes ALL scrolls while I need only one removed. Then I tried A3/1063/1/1, it removes one scroll at time but spell remains in book


Edit: solved, I think I missed refresh scripts, now it works.


Another strange issue:

!?AE1&v998=164;  ring
!!VRv5798:+1;
!!IF:W-1;
!!VRw3&v5798=9:S99;
!!VRz1&w3=99:S^shield.wav^;
!!IF&w3=99:L^Chestguard activated!^;
!!SN&w3=99:Pz1;

When I click on any other artefact in backpack (if combo is equipped), it triggers the text and sound 10-20 times in a row. I thought it depends only on the artefact ID from trigger, but there is a glitch.

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


Supreme Hero
Work at Magic Dimmension
posted March 12, 2013 08:19 AM

why !!CO:E gives me improper commander window?


Quote:
!?FU55003; //spawn commanders
!!SN:W^majaczek.LHE^/?y1; !!SN:W^majaczek.RHE^/?y2;
!!SN&y1>-1:W^majaczek.LCO_D^/?y3; !!SN&y2>-1:W^majaczek.RCO_D^/?y4;
!!SN&y1>-1:W^majaczek.LCO_E^/?y5; !!SN&y2>-1:W^majaczek.RCO_E^/?y6;
!!SN:W^majaczek.LCO_T^/?y7; !!SN:W^majaczek.RCO_T^/?y8;
!!VRy7:+174; !!VRy8:+183;

!!VRy9:S-1; !!VRy10:S-1;
//use BU for summon - BM just crash
!!BU&y1>-1/y3=0/y5=1:Sy7/1/89/0/-1/0 E89/?y9;
!!BU&y2>-1/y4=0/y6=1:Sy8/1/97/1/-1/0 E97/?y10;
!!VRx1:Sy9; !!VRx1:Sy10;

!!CO-3&v7083>-1:E1;
!!CO-4&v7085>-1:E1;


the second commanders look good, but it shows info of some paladin

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

Tavern Dweller
posted March 12, 2013 08:51 AM

Very new to ERM, so apologies if this is something simple that I have missed.

I would like to give a creature specialist an additional bonus to their favoured creatures - a static +A/+B to attack and defense for the basic creature, and +C/+D to attack and defense for the upgraded creature. This is on top of the standard creature specialist bonuses.

By way of example, let us say that I wish to give Skeletons under the command of Galthran +1 to attack skill, and +2 to defense skill, while I want to give Skeleton Warriors under his command +2 to attack skill, and +3 to defense skill, on top of the default bonuses that his specialty provides.

How can this be achieved?
____________

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


Responsible
Supreme Hero
posted March 12, 2013 02:34 PM

Salamandre: I think everything you described is explained in ERM Help. For example:

----------ERM Help Quote----------------
Equip/Unequip artifact trigger:
!?AE0; Take off an artifact
!?AE1; Put on an artifact
The current Hero (!!HE-1) is a Hero-owner
  v998 keeps an artifact number
  v999 keeps a position (slot) number

Comments.
It does not work for backpack.
If you change one artifact to another, it produces some extra
triggers call. Here it is:
  1. AE0 (prev)
  2. AE1 (prev)
  3. AE0 (prev)
  4. AE1 (new)
  5. AE0 (new)
  6. AE1 (new)
If you take an artifact from a backpack and a slot that this
artifact may be placed is busy, you will get the next sequence for
every slot this artifact may be placed:
  1. AE0 (prev)
  2. AE1 (prev)

-------------ERM Help Quote ends---------------------------

See the Dress Code script for examples of counting artifacts with HE:A2, removing all with HE:A-, then adding some back (based on the count).

Majaczek: I don't know but my quess is when you use CO commands WoG expects Commanders to be based on Heroes. There is always an attacking Hero, but not always a defending Hero so the Hero properties WoG uses as a basis for defending Commander creatures could be bogus. Whenever I have used Commander creatures (e.g., "Stargate Atlantis") (not to be confused with "Stargate Atlantis Rising") I have used them as creatures with MA and BM commands, so I am not high on their learning curves.

Crunch: use BM commands to affect specific stacks in battle. Check all the starting stacks (stack numbers 0-6 for attackers, 21-27 for defenders) in a DO. Check stack type with BM:T? and Hero numbers with BA:H#/? and when the right combination occurs, apply the desired improvements. Do this under the BF trigger (which occurs after the first BR trigger according to the sequence of battle triggers given in ERM Help, so stacks will be set up by then). If you want the improvements to also apply to Summoned and Cloned stacks, you will have to do it at the start of each battle round (BR) and check every stack (0-20 and 21-41). This will rapidly get more complicated so as not to give the same stack multiple improvements, but could be done (taking into account experience bonuses with the EA commands).

Shorter answer to all three: everything I have said can be learned by reading ERM Help thoroughly and practicing.  This is much more difficult for non-English/non-Russian readers but those who are not capable of it will never be expert scripters (unless there is a good translation). After all, reading my advice is practically the same as reading ERM Help, so if you can read me you can read ERM Help. Don't expect to understand everything at once, but reading is the first step to understanding. Things you read later will help explain things you read earlier, and practice is also necessary. Start with the introduction, the tutorials ("ERM for Dummies"), and the Flags and Variables sections.

I keep saying this because a) it is true and b) ideally I would prefer to offer suggestions based on experience and thought rather than acting simply as an ERM-Help-look-up service. My lecture may be misapplied to some who have read all of ERM Help but need help interpreting it, but in many cases it seems to me to be appropriate. No offense is meant, I had to learn this philosophy (always read the whole manual, it saves much time and aggravation) myself early in my engineering career.

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


Promising
Undefeatable Hero
My BS sensor is tingling again
posted March 12, 2013 04:03 PM
Edited by artu at 16:22, 12 Mar 2013.

Quote:
This is much more difficult for non-English/non-Russian readers but those who are not capable of it will never be expert scripters (unless there is a good translation).


JimV, with all respect and I mean that, not everybody who uses ERM wishes to be EXPERT scripters. Think of this like fishing, an expert fisherman will surely now all kinds of detail about which hour to fish in summer and in winter, where exactly he should be on the lake, what kind of bait he should be using according to the variables etc etc. But some of us only ask you how to hold the fishhook. We don't want to be expert fishermen, we just want to customize our game a little bit.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 12, 2013 04:50 PM
Edited by Salamandre at 17:12, 12 Mar 2013.

My fault, I missed the comments below AE trigger. I was testing the script separately in a test map with a few artefacts and the glitch did not happen, but now I understand the glitch occurs when the artefact you select in backpack goes into a slot already busy. Good to know, thanks.

@Artu: yeah I agree. Even if you read it entirely there will be still some things in it which will not make sense until you make that particular script and experience strange errors. I think is not a matter of reading erm help, but practice: more you script, more there is a chance you browse the help. You don't need to be expert to be able to script nice things, but sometimes simple ideas (at first look) may require complex scripting.

@Crunch:

To change a monster stats under a specific hero, you need:

!?BA trigger (or !?BF better I think)
;check both heros fighting, if two (BA:H)
;if galthran, do a loop with DO on his 7 battle stacks (DO$/0/20/1 or DO$/21/41/1, depending on if he is attacker or defender)
;check the x16 ID (BMx16:T)
;if skeletons/upgraded, add bonus to that battle stack. (BMx16:U)

Try to write something based on that and show result.

@Edit: sorry, I see JimV already gave the direction, didn't read past the part which concerned my problem first.

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


Responsible
Supreme Hero
posted March 12, 2013 06:02 PM

I understand some people don't want to learn how to script, they just want magic things to happen in their maps, but there is a basic contradiction there. If you want to have magic things happen in your map, someone must do the work of learning ERM and writing the script.

The facts as I see them are that any thinking person who can understand written English or Russian can learn ERM in about two weeks (spending at least two hours per day), by reading all of ERM Help and practicing. Not a trivial amount of effort, but much less than learning a sport or musical instrument, and I think the rewards of being able to implement your own ideas are worth it.

Given the facts as I see them, the most charitable assumption I can make about people who ask basic ERM questions is that they would like to learn ERM but need my lecture to explain how this can best be done. (I very much doubt that anyone will ever learn ERM by asking questions here without reading ERM Help and practicing.)

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


Admirable
Omnipresent Hero
Wog refugee
posted March 12, 2013 06:24 PM
Edited by Salamandre at 18:37, 12 Mar 2013.

heh, two weeks, I want to see that. You simply can't realize how hard and long is to get past abstract concepts as variables, flags, passing variable to function, bits, for someone who never was in. You can't spend two hours/day reading something you have no clue what's about.

It is not a coincidence that almost all people who script today made their studies or had a job related to computer programming. It took me 6 months to understand what x1-x16 means because at that time nobody answered my question, probably they thought is not worth to spend time on a noobie.

You first assume everyone asking here for help has some laziness issue-maybe for some of them is true-, while the problem is obvious: computer languages have unique logic and instead of being moralized, people need directions and examples first, which indeed makes the helper task very redundant, but that's it.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted March 12, 2013 07:37 PM

Two weeks at two hours a day might be optimistic, but ask yourself at what point had you finally read all of ERM Help and practiced the tutorials and done examples of all the commands which were unclear to you to see how they worked. Then ask yourself how much time it would have taken to read all of ERM Help continuously instead of a bit at a time, and to practice the examples in ERM Help (with IF:M commands to see how things are changing). In other words, how much time over the six months did you actually spend learning?

Variables are explained, with examples, in the Flags and Variables section - probably as well as I could explain them. None of us were born knowing what variables are. I first heard of them many years ago in a college Fortran course, but the sentences used to explain them were much the same as those used in ERM Help and I don't recall any difficulty then.

Your English is very good, but I suspect there was some language-barrier difficulty.

I am willing to try to explain concepts such as variables using different examples, such as the mail box analogy, but what I want to see as a question is something like, "I read about v-variables and y-variables in ERM Help, but I don't understand what a variable is and how it is used, can you explain this some more?"

Of course, for general terms used in computer programming such as "variable", one can also use Google. Examples:

--------------------------------------------------
Variable:

A symbol or name that stands for a value. For example, in the expression
x+y
x and y are variables. Variables can represent numeric values, characters, character strings, or memory addresses.
Variables play an important role in computer programming because they enable programmers to write flexible programs. Rather than entering data directly into a program, a programmer can use variables to represent the data. Then, when the program is executed, the variables are replaced with real data. This makes it possible for the same program to process different sets of data.
Every variable has a name, called the variable name, and a data type. A variable's data type indicates what sort of value the variable represents, such as whether it is an integer, a floating-point number, or a character.
The opposite of a variable is a constant. Constants are values that never change [e.g., "3" or "Sorry". Because of their inflexibility, constants are used less often than variables in programming.
-------------------------------------------------
Variables in programming languages are simply containers which hold values.  Access to variables and the contents of them is through their name, also know as their identifiers.
------------------------------------------------
In programming, a variable is a value that can change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that tell the computer what to do and data that the program uses when it is running. The data consists of constants or fixed values that never change and variable values (which are usually initialized to "0" or some default value because the actual values will be supplied by a program's user). Usually, both constants and variables are defined as certain data types. Each data type prescribes and limits the form of the data. Examples of data types include: an integer expressed as a decimal number, or a string of text characters, usually limited in length.
----------------------------------------------------
In computer programming, a variable is a symbolic name given to some known or unknown quantity or information, for the purpose of allowing the name to be used independently of the information it represents. A variable name in computer source code is usually associated with a data storage location and thus also its contents, and these may change during the course of program execution.
-------------------------------------------------------
Variables in a computer program are analogous to "Buckets" or "Envelopes" [or mail boxes] where information can be maintained and referenced. On the outside of the bucket is a name. When referring to the bucket, we use the name of the bucket, not the data stored in the bucket.
------------------------------------------------------------

In this way, articles can be found that are in the searcher's native language!

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


Promising
Undefeatable Hero
My BS sensor is tingling again
posted March 12, 2013 07:48 PM

I think you are missing the point here, it's not about how to be an expert scripter. My objection was about how misplaced it was to treat all questions as if they were asked by people who wanted to be experts.

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


Admirable
Omnipresent Hero
Wog refugee
posted March 12, 2013 08:16 PM
Edited by Salamandre at 20:42, 12 Mar 2013.

It still gives me head ache. How to script split troops in equal stacks?!

My logic was as follow:

1) get slot clicked
2) get creatures number, type and experience in
3) propose dialog to choose split value (in this case, 4, 5 or 6)
4) run through slots and find if enough are empty
5) if found enough empty, add x equal stacks in empty ones
6) when loops run through the clicked slot, reduce the number to split choice.

I can get it until a point, but the split value is wrong, I get more than I should, I probably took a wrong and too complicated way.

!?CM2;
!!CM:I?y-40 F?y-41;
!!FU|y-40<68/y-40>74/y-41<>4:E; [Ctrl + left-click on stack]
!!OW:A-1/?y-42; [get active hero in y-42]
!!VRz1:S^Choose your split^;
!!VRz2:S^4 equal stacks^;
!!VRz3:S^5 equal stacks^;
!!VRz4:S^6 equal stacks^;
!!VRz5:S^Leave^;
!!IF:G1/2/0/z1/z2/z3/z4/z5;
!!FU&v2=8:E;
!!VRy-40:-68; now y-40=slot # from 0 to 6
!!HE-1:C0/y-40/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
!!VRy2&v2=1::4; [4 stacks]
!!VRy2&v2=2::5; [5 stacks]
!!VRy2&v2=4::6; [6 stacks]
!!VRv7814:C0/0; [initialize empty slots counter in v7814-v7815]
!!DO987987/0/7/1:Py-42/v2/y1/y2/y3; [run through hero slots]
!!IF&v2=1/v7814<4:M^You need 4 empty slots!^;
!!FU&v2=1/v7814<4:E;
!!IF&v2=2/v7814<5:M^You need 5 empty slots!^;
!!FU&v2=2/v7814<5:E;
!!IF&v2=4/v7814<6:M^You need 6 empty slots!^;
!!FU&v2=4/v7814<6:E;
!!DO987988/0/6/1:Py-42/v2/y1/y2/y3/y-40; [add split now]

!?FU987988;
;x1 hero ID
;x2 stack splitting choice
;x3 monster ID
;x4 number
;x5 experience
;x6 slot clicked
!!HEx1:C0/x16/?y1/?y2;
!!HEx1&x16<>x6/y1<1:C0/x16/x3/x4/x5/2;
!!HEx1&x16=x6:C0/x16/x3/x4/x5/2;[if slot clicked is same as slot x16]
!!VRv7815:+1;
!!VRx16&v7814=v7815:S99;
!!FU&v7814=v7815:E;

!?FU987987; [check if enough empty slots for the selected split
;x1 hero ID
;x2 stack splitting choice
;x3 monster ID
;x4 number
;x5 experience
!!HEx1:C0/x16/?y1/?y2; check for empty slots
!!VRv7814&y1<0:+1; counter empty slots if find one


@artu; Yes, but people ask what they think simple questions but most of those question require expert scripter level. Example your cartographer. ;)

 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 50 100 150 ... 191 192 193 194 195 ... 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.6751 seconds