Map Database  •  FAQ  •  RSS  •  Login

Dynamic Script idea for Town Hall units in a map

<<

Rey

User avatar

KaM Remake Developer

Posts: 217

Joined: 12 Oct 2016, 07:41

KaM Skill Level: Fair

Location: Moscow

Post 29 Jan 2017, 22:49

Re: Dynamic Script idea for Town Hall units in a map

Hey, thunder!

Recently I was testing your map and found a small bug with your script.

When there is no free space at the exit from barracks, player train normal barracks units, they stuck inside barracks and you immidiately train Town hall units (switch by repair btn), then after finally soldiers get outside of barracks they will have same type (Town hall/not Town hall).
Here is gif recorded:

https://puu.sh/tFV29/c14ac7f8fd.gif

Not sure if its easy to fix, also its minor bug. But anyway, you have to know ^)

Btw, Ben, you said you will create a new topic for offtopic, which was here :) Just saying...
<<

thunder

User avatar

Moorbach's Guard

Posts: 1044

Joined: 15 Apr 2012, 12:11

KaM Skill Level: Fair

Location: In the Market

Post 30 Jan 2017, 16:51

Re: Dynamic Script idea for Town Hall units in a map

Thanks! Yes, it is a known issue. You must not have to switch repair button while training a big group of one type of units. for example when clicking 100soilders and switching the repair button then you will get 2 kinds of unit, so the unit type will switch also! It is well known because the script is base on the OnTrainedUnit event or WarrioeEquiped...When a unit is trained then check the button even when the player thinks it is a group what get, but it is illusion.The player get only 1unit at time. The groupmaking and switching units to another one etc is happening only after this.
IT is not bug. It is the limit of this dynamic script. You have to wait until the units come out and switch the repair button after.
MAybe should block the repair button while the TH groups arrived out, but for this would need some speciel variable counters etc.... Im not as good in programming, as i said i m a kind of baker in computertechnology. :wink:
<<

Rey

User avatar

KaM Remake Developer

Posts: 217

Joined: 12 Oct 2016, 07:41

KaM Skill Level: Fair

Location: Moscow

Post 30 Jan 2017, 17:11

Re: Dynamic Script idea for Town Hall units in a map

Ok, I see.

May be it will be easier if we add some new functions in dynamic scripting, smth like 'OnTrainUnitCommandIssued', which will be invoked not when unit get outside of building, but when it was only in plans. Will it solve this issue ?

Another guys from russian community dound another bug, he posted a video about it: https://yadi.sk/i/fgX3fNuj3BtHM4
At the end of a video normal (not Town hall) units just dissapear when exit from barracks
<<

thunder

User avatar

Moorbach's Guard

Posts: 1044

Joined: 15 Apr 2012, 12:11

KaM Skill Level: Fair

Location: In the Market

Post 30 Jan 2017, 19:40

Re: Dynamic Script idea for Town Hall units in a map

Another guys from russian community dound another bug, he posted a video about it: https://yadi.sk/i/fgX3fNuj3BtHM4
At the end of a video normal (not Town hall) units just dissapear when exit from barracks
It is normal. It worked well. The player wanted to train milities, but he did not have enough AXE in the barrack (AX min 101 , if less then milities be killed). He had only 100axes which is equal 0. Script worked well in SP mode also(? wow?) because he got the warrior which means it was ok (cost 1IronArmor+2swrds+1recruits)
100wares given to barrack because in multiplayer we can save lots of time to train the units in big groups with the mouse right cklick. It is also only a little trick as dynamic scripts manytimes using tricks. :S
Originaly 100 was 1 because we need to enable the training button to be able to create TH units which would not need leatherjackets etc. We could not train REbel or rougge if there would not be minimum 1 leatherjacket in the barrack.
The silent kill is necesarry because 100 is not a bonus added weapons it is only comfort things for the players.

I would recommend to translate the pdf file to russian language to make the script more understable for the players.
I dont know how could it be programmed on much better way. MAybe you, Andreus or some famous programmer could do it on the right way. It is really was only an example to present an idea and way to implement the TH units.
May be it will be easier if we add some new functions in dynamic scripting, smth like 'OnTrainUnitCommandIssued', which will be invoked not when unit get outside of building, but when it was only in plans. Will it solve this issue ?
I dont really know how should it work. Maybe Krom or Lewin could help in this case.
Seems programmers can reacting only on the trained units events, so if the PLAN would mean the click on the selected trained units maybe could help and could solve this case in this dynamic script.

Anyway the players welcomed this scipt but still they dislike because how its looks out and the tricks and the disabled trades because the added 100wares... :( They rather would train these units on normal way like the regular units are trainable.
<<

sado1

User avatar

Council Member

Posts: 1430

Joined: 21 May 2012, 19:13

KaM Skill Level: Skilled

Post 30 Jan 2017, 23:26

Re: Dynamic Script idea for Town Hall units in a map

"OnTrainUnitCommandIssued" would not help with the issue of having to have 100 jackets, shields and axes. The reason you have to have them, is that you need to "light up" the button, to be able to push it. Better would be to allow to make the unit train button "clickable" instead; however this is pretty much the same as simply allowing to add non-standard units to barracks; why not do this instead if we want to allow something like this anyway?

Main complaints about the script were 1. that the units get killed before the barracks, and then the real units get made (this would be better with OnTrainUnitCommandIssued) and 2. that you have to click (for example) repair, then militia to get a barbarian, which is counter intuitive and needs a PDF to explain it.

I'd rather have custom units, maybe even with custom (translatable?) names, if possible. The script would ask for the name (you can use standard translated unit names like in any other script), the unit ID for the unit picture, and the "price" for the unit (a list of weapon IDs).

I'm pretty sure though that this will not be implemented for various reasons, this is a bit of an extreme idea, and I can totally see Lewin and Krom not wanting this in place.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 31 Jan 2017, 02:21

Re: Dynamic Script idea for Town Hall units in a map

Btw, Ben, you said you will create a new topic for offtopic, which was here :) Just saying...
Thank for the reminder, but the topic didn't go astray too much for too long, and it's quite fine now imo. I'll leave it as it is.
I used to spam this forum so much...

Return to “Dynamic Scripting”

Who is online

Users browsing this forum: No registered users and 9 guests