|
|
bloodsucker

 
     
Legendary Hero
|
posted April 17, 2016 09:17 PM |
|
|
So what is modular division (%) for?
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted April 17, 2016 09:24 PM |
|
|
This why I was asking, is reminder, not division.
-# Subtract # from the variable
*# Multiply the variable by #
:# Divide the variable by # (do not divide by zero - you will get an error message)
%# Set the variable to the reminder from division by #
|
|
bloodsucker

 
     
Legendary Hero
|
posted April 17, 2016 09:27 PM |
|
|
!!VRv4::2; v4 divided by 2
I don't see where this fits.
!!VRy6&v4>0&y2=1:Sv4:4;
* here y6 is the army value of the opponent hero while v4 is player's army value
|
|
bloodsucker

 
     
Legendary Hero
|
posted April 17, 2016 09:33 PM |
|
|
Salamandre said: :# Divide the variable by # (do not divide by zero - you will get an error message)
%# Set the variable to the reminder from division by #
Arithmetic operators
These were covered above, but in summary,
+ is addition
- is subtraction
* is multiplication
: is division
% is modulus ?
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted April 17, 2016 09:51 PM |
|
|
You should comment each line of your script, as I have no idea what you trying to do. The division v4:2 was only a division example, as I thought you use % for dividing, while it is only the remainder after already done division.
|
|
bloodsucker

 
     
Legendary Hero
|
posted April 18, 2016 01:15 PM |
|
|
I admit I'm not to good at commenting but I tried this time, looks like a novel in the middle...
OK, I tought I had understood how the SN: vars worked last time but or I did forgot something important or I'm making some stupid logic mistake over and over.
So, I tested it and tested it and now I have about half of the bone struture done but I'm missing something important cause while I replace the objects with the boxes and have them scanned, I am not getting those results written to the relative assigned (x,y,l) vars.
If you want I have a mod (with a test map included) that I can upload to Dropbox or something.
Here I'm headlinning where I believe the problem is:
***
!#SN:W^Box_at_%V952_%V953_%V954_Level^;
!#SN:W^Attacker_Fight_Value^;
...
[Finding the fixed attributes (level, type of opponents, type of rewards) for each box]
!!UN:U101/6/?v951; [count number of TC6's]
!!VRv952:S-2; [Initialize v952 to last object for faster UN:U format]
!!DO23154698/1/v951/1:P6; [do a loop for each object]
...
!?FU23154698; x1=TC subtype
[Function to apply fixed values to each box]
!!FU&x1<>6:E; exit if not TC6
!!UN:U101/x1/-2/952; Get coordinates of the box in v952-v954
[Adjust the frequence of the different levels of boxes]
!!VRy5:R28;
!!VRy2&y5<=10:S1; 11 of 29
!!VRy2&y5>10/y5<=16:S2; 6
!!VRy2&y5>16/y5<=20:S3; 4
!!VRy2&y5>20/y5<=23:S4; 3
!!VRy2&y5>23/y5<=25:S5; 2 - here I want to start the Big Money boxes,
!!VRy2&y5>25/y5<=27:S6; 2 would 5 over 29 be too much?
!!VRy2&y5=28:S7; 1
* As you can see the boxes are scanned and the Level is found BUT it is not charged to the relative variables
* so whatever I'm doing wrong has to do with the way x,y,l references are used to assign/read the variables
!!IF:M^Y2=%Y2^;
[Identify each box]
!!SN:W^Box_at_%V952_%V953_%V954_Level^/y2; write the value obtained to global var
***
and here is the whole script note there are many lines that are just for testing or will be used latter for other things (like to have several aligments to randomly choose from for each level)
***
ZVSE
[ERM Enable Treasure Chest 6]
!#UN:B6/1;
*#SN:W^Box_at_%V5_%V6_%V7_Level^;
*#SN:W^Box_at_%V5_%V6_%V7_Fight^;
*#SN:W^Box_at_%V5_%V6_%V7_Reward^;
!#SN:W^Box_at_%V952_%V953_%V954_Level^;
!#SN:W^Attacker_Fight_Value^;
[Runs only in the first days]
!?TM2&$day$=1/$once$=1;
[Searching for objects to replace with TCs type 6]
!!UN:U79/-1/?y-1;
!!VRv1:S-1;
!!DO23154699/1/y-1/7&y-1>0:P79/4; crystal - 1 of 7 piles
!!UN:U79/-1/?y-1;
!!VRv1:S-1;
!!DO23154699/1/y-1/7&y-1>0:P79/5; gems - 1 of 7 piles
!!UN:U79/-1/?y-1;
!!VRv1:S-1;
!!DO23154699/1/y-1/5&y-1>0:P79/6; gold - 1 of 5 piles
!!UN:U6/-1/?y-1;
!!VRv1:S-1;
!!DO23154699/1/y-1/1&y-1>0:P6; all pandora boxes
[Finding the fixed attributes (level, type of opponents, type of rewards) for each box]
!!UN:U101/6/?v951; [count number of TC6's]
!!VRv952:S-2; [Initialize v952 to last object for faster UN:U format]
!!DO23154698/1/v951/1:P6; [do a loop for each object]
!?FU23154699;
[Function to replace the selected objects with TCs 6]
!!UN:Ux1/-1/-1/1;
!!OB1:U?y1;
!!FU&y1<>x2:E;
!!UN:Ov1/v2/v3;
!!UN:Iv1/v2/v3/101/6; treasure chest (101) type 6
!?FU23154698; x1=TC subtype
[Function to apply fixed values to each box]
!!FU&x1<>6:E; exit if not TC6
!!UN:U101/x1/-2/952; Get coordinates of the box in v952-v954
[Adjust the frequence of the different levels of boxes]
!!VRy5:R28;
!!VRy2&y5<=10:S1; 11 of 29
!!VRy2&y5>10/y5<=16:S2; 6
!!VRy2&y5>16/y5<=20:S3; 4
!!VRy2&y5>20/y5<=23:S4; 3
!!VRy2&y5>23/y5<=25:S5; 2 - here I want to start the Big Money boxes,
!!VRy2&y5>25/y5<=27:S6; 2 would 5 over 29 be too much?
!!VRy2&y5=28:S7; 1
* As you can see the boxes are scanned and the Level is found BUT it is not charged to the relative variables
* so whatever I'm doing wrong has to do with the way x,y,l references are used to assign/read the variables
!!IF:M^Y2=%Y2^;
***
[Identify each box]
!!SN:W^Box_at_%V952_%V953_%V954_Level^/y2; write the value obtained to global var
[HERE ENDS THE GLOBAL PROCEDURES AND START THE ONES RELATIVE TO EACH BOX/HERO INTERACTION]
!?OB101/6&-875;
!!HE-1:N?y1; get hero number
!!HE-1:P?v5/?v6/?v7;
!!VRv2:C0/0;
!!SN:W^Box_at_%V952_%V953_%V954_Level^/?y2; read global var to get the predefined level of this box
*!VRy2:S1; for test
!!IF:M^This is a box of level: %Y2^;
!!DO23154688/0/6/1:Py1; get the fight value of player's army
!!SN:W^Attacker_Fight_Value^/?v4;
[Find the army value of the opponents]
!!VRy6&v4>0/y2=1:Sv4:4;
!!VRy7&v4>0/y2=1:Sv4:4;
!!VRy6&v4>0/y2=2:Sv4:2;
!!VRy8&v4>0/y2=2:Sv4:2;
!!VRy6&v4>0/y2=3:Sv4;
!!VRy6&v4>0/y2=4:Sv4+y7;
!!VRy6&v4>0/y2=5:Sv4+y8;
!!VRy6&v4>0/y2=6:Sv4*2;
!!VRy6&v4>0/y2=7:Sv4*3;
[Test]
* this is just for testing but is like I intend to fill the opponent hero army,
* in y9 I have now the number of marksmen that represent the fight value (20%, 50%, etc...)
* of THIS box for this army. I can then divide that number to get different stacks of different troops.
* As you can see for yourself if you uncomment *!VRy2:S1; above, all things work but the relative reference
* of the boxes
!!VRy9:Sy6:115;
!!HE-1:Tv7/v8/v9/3/y9;
[Salamandre's function to find heroes fight-value]
!?FU23154688;
!!HEx1:C0/x16/?y1/?y2;
!!FU&y1<0:E;
!!MA:Fy1/?y3;
!!VRv3:Sy3*y2;
!!VRv4:Sv4+v3;
!!SN:W^Attacker_Fight_Value^/v4;
P.S. Btw, I'm using v952+ but I wanted to use v5, v6 and v7, I don't think there is a problem with that but I tried to keep things as close to the original as I could to remove to possibility of introducing new errors before I solve this one.
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted April 18, 2016 02:44 PM |
|
|
here is your fault:
!?OB101/6&-875;
!!HE-1:N?y1; get hero number
!!HE-1:P?v5/?v6/?v7;
!!VRv2:C0/0;
!!SN:W^Box_at_%V952_%V953_%V954_Level^/?y2; read global var to get the predefined level of this box
Should be:
!?OB101/6&-875;
!!HE-1:N?y1; get hero number
!!HE-1:P?v5/?v6/?v7;
!!VRv2:C0/0;
!!SN:W^Box_at_%V998_%V999_%V1000_Level^/?y2; read global var to get the predefined level of this box
Because object is at coordinates v998, v999 and v1000. Which must match now the previously used v952-v954
Try now.
____________
Era II mods and utilities
|
|
bloodsucker

 
     
Legendary Hero
|
posted April 18, 2016 02:59 PM |
|
|
So the fact the I'm using v5 here doesn't affect where the location is stored? I can always find v998 to v1000 even if I'm not charging the location there at any moment? Tought those values were just a convention.
Well, it works. Got a level 1 and got owned by a level 7.
THANKS
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted April 18, 2016 03:04 PM |
|
|
No, they are not a convention, you made lethal error in using them.
Let's say you place a box at 15/75/0 coordinates.
So now v952 is 15, v953 is 75 and v954 is 0, ok?
So now you code your:
!!SN:W^Box_at_%V952_%V953_%V954_Level
Which means:
!!SN:W^Box_at_15_75_0_Level, OK?
Now you visit this box and ask:
!!SN:W^Box_at_%V952_%V953_%V954_Level^/?y2;
But v952-v954 changed a billion of times sine you set this box, as you used them for EVERY box, ok?
So you must check current object location with v998-v1000 (they are automatically set when you visit an object. Then ask:
!!SN:W^Box_at_%V998_%V999_%V1000_Level^/?y2;
And if this match the previously used:
!!SN:W^Box_at_15_75_0_Level,
Then is ok.
I hope is clear, if not, use debug messages in a map with only 2-3 boxes so you can see your error.
____________
Era II mods and utilities
|
|
bloodsucker

 
     
Legendary Hero
|
posted April 18, 2016 03:08 PM |
|
|
It is, you are a great teacher.
So, let's test my compreension: I can SET any number for those vars but I always need to GET them from v998, v999, v1000 that are prevously charged when the visit triggers.
This works pretty well btw, the hier boxes are quite hard to take at lower levels while good army provides good experience from lower level boxes. Nice.
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted April 18, 2016 03:17 PM |
|
|
v998-v1000 are automatically assigned when you visit something. This is why
!!OB998 means the current object.
So yes, you need that. But just use my one line change, it will fix all.
____________
Era II mods and utilities
|
|
bloodsucker

 
     
Legendary Hero
|
posted April 18, 2016 03:25 PM |
|
|
Oh, and once again: thanks for Trainner. When you need to test something like this it is behind helpfull.
On a side note, I'm starting to think the best way to do this is to assign a (small) base number to each slot and then add the army value fractions to those numbers. This way the box has a 'residual' army that combined with the neutral hero pretty much prevent abuses like take a level 7 box just with 'ghost army' to immediatly get overpowering army and relics, for instance.
I would pretty much like to engage RoseCavalier or Biobob on this discussion but I guess you at least have pretty good ideas about it.
I'm not sure what superplayers think about the ballance between hard to take and reward good playing but note that like it is a losy player gets tremendous rewards from the boxes while an exceptional one will only take minimum values.
Is this acceptable?
Another thing, is it too creepy to change the terrain so that battles always take place in opponents natural terrain? I know for a fact this to be one of those things that affect player according to their play stile.
|
|
Salamandre

     
       
Admirable
Omnipresent Hero
Wog refugee
|
posted April 18, 2016 03:28 PM |
|
|
The last version added F6-F7 to get click coordinates and move-to hero, by Biobob request.
|
|
majaczek

 
    
Supreme Hero
Work at Magic Dimmension
|
posted April 23, 2016 06:21 PM |
|
Edited by majaczek at 18:23, 23 Apr 2016.
|
I can't find the UN:C code to disable orb of inhibition default effect (searched for obvious memory codes in ollydbg and searched HC forums for UN:C hacks).
so hmm it probably wasn't asked as most of other questions 
what is code to disable default effects of:
1) Orb of Inhibition (artifact)
2) Recanter's Cloak (artifact)
3) Grail Building from Conflux
4) Grail Building from Tower
5) Grail Building from Inferno
???
(I will prepare a script with alternate effects)
EDIT: I suppose reading others mod's code may help me. what you would suggest to brief?
|
|
igrik

  
  
Promising
Known Hero
|
posted April 24, 2016 07:35 AM |
|
Edited by igrik at 07:59, 24 Apr 2016.
|
; 126 Orb of Inhibition (artifact)
!!VRy1:S126; number of art (x<128)
!!UN:C4323947/1/y1;
!!UN:C4323975/1/y1;
!!UN:C4324250/1/y1;
!!UN:C4324275/1/y1;
!!UN:C4328726/1/y1;
!!UN:C4328750/1/y1;
!!UN:C4330554/1/y1;
!!UN:C4330579/1/y1;
!!UN:C4337706/1/y1;
!!UN:C4337731/1/y1;
!!UN:C4341604/1/y1;
!!UN:C4341739/1/y1;
!!UN:C4792396/1/y1;
!!UN:C5403247/1/y1;
!!UN:C5893338/1/y1;
!!VRy1:*32;
!!UN:C5893500/4/y1;
; 83 Recanter's Cloak (artifact)
!!VRy1:S83; number of art (x<128)
!!UN:C4348936/1/y1;
!!UN:C4348962/1/y1;
!!UN:C4441266/1/y1;
!!UN:C4441203/1/y1;
!!UN:C5405343/1/y1;
!!UN:C5932058/1/y1;
!!UN:C5932079/1/y1;
!!UN:C5893758/1/y1;
!!VRy1:*32;
!!UN:C5893843/4/y1;
; Grail Building from Conflux
!!VRy1:S9; number of town (x<128)
!!UN:C6022390/1/y1;
!!UN:C6088735/1/y1;
!!UN:C6088214/1/y1;
!!UN:C6124606/1/y1;
|
|
majaczek

 
    
Supreme Hero
Work at Magic Dimmension
|
posted April 24, 2016 12:38 PM |
|
Edited by majaczek at 14:22, 24 Apr 2016.
|
Really thanks Igrik :)
I'd like also Grails of Tower and Inferno, but most o important codes You already provided :)
EDIT:
Quote:
; Grail Building from Inferno
!!VRy1:S99; number of town (x<128)
!!UN:C5680014/1/y1;
!!UN:C5680295/1/y1;
!!UN:C6020842/1/y1;
!!UN:C6129967/1/y1;
Is this code correct? It's my educated guess :F
I guessed something to search for tower grail, but it seems it has more hits than it need :(
please check my inferno codes, and please deliver me an Tower code :)
(my guess for Tower would have 9 codes while other two have exactly 4 codes)
EDIT:
it only disables Grail Building, I want it accessible but Blank, so I can make it have new properites, Inferno code seems to work for disabling similair to conflux one :P
Please Help :(
|
|
fred79

      
Disgraceful
Undefeatable Hero
|
posted April 25, 2016 05:07 AM |
|
|
i still need help with creature sound scripts(replacements for wog creatures)... 
atm i'm still trying to replace creature 137's move, attack, defend, wince, and death sounds. using PIRTATTK, PIRTKILL, etc. the shot sound's already taken care of(thanks again, hawaiing).
|
|
igrik

  
  
Promising
Known Hero
|
posted April 25, 2016 10:11 AM |
|
Edited by igrik at 10:17, 25 Apr 2016.
|
majaczek
It is necessary to search. But I have no time at the moment. Maybe later
fred79
!?PI; !!VRz1:S^PIRT^; !!FU25003:P137;
!?GM0; !!VRz1:S^PIRT^; !!FU25003:P137;
!?FU25003; voice change
; x1 - monster number
!!UN:C4697553/4/?y1;
!!VRy2:S116*x1+y1+8;
!!UN:Cy2/4/?y3;
!!SN:K4/?z1/y3/1;
And so can be on each monster.
for example:
!!VRz1:S^Ogre^; !!FU25003:P138; monster number 138
!!VRz1:S^Deni^; !!FU25003:P151; monster number 151
!!VRz1:S^Lexn^; !!FU25003:P167; monster number 167
|
|
fred79

      
Disgraceful
Undefeatable Hero
|
posted April 25, 2016 10:30 PM |
|
|
thanks, igrik. i'll give that a try.
|
|
igrik

  
  
Promising
Known Hero
|
posted April 25, 2016 11:04 PM |
|
|
; grail inferno bonus
!!UN:C5015000/1/3; number of town
|
|
|