You must be logged in to post messages.
Please login or register

Scenario Design and Discussion
Moderated by Sebastien, Mr Wednesday

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: How to save time with AOK Trigger Studio
posted 07-28-12 03:49 PM CT (US)   
Before few month one guy from aok heaven gave me tip to program that can save much of time. I believe here are guys who use it already. I use autohotkey (autohotkey L) to speed up my work with AOK Trigger Studio. It is simple program where you can write your very simple scripts, which will do many of the job for you. Last days I did this way hundreds of triggers, conditions and effects and it help me a lot. It is more reliable to make things automatically then by hand, when man can do mistakes.

I will give here few script to show you how it works and what it can do. I am not ahk pro, but I use it this way.

Just to explain few things before I paste the examples.

AHK can switch between windows like between notepad (where you can have coordinates, names of units and there HP/AP or any values you need to work with) and AOK TS. If you have just on TS Window opened you just type

WinActivate,AOK Trigger Studio
To Activate window with TS.
You type

WinActivate,numbers.txt
to activate your notepad window, from where you will get the numbers. You can get the number by search in file of just with copy/paste from your text selection (which is my favourite method, because it is very simple and quick to write).

If you copy text, you need to wait some time, this depends on program. AOK 1.0 is slower and contains some bugs, but I use it for copying triggers (or conditions or effects) from one TS window to second TS window. AOK 1.0.1 is faster if I want to edit triggers, conditions and effects. To copy trigger from TS 1.0, I wait 250 milisecond. To paste and insert text from clipboard, depending on the size of text, I wait very short time about 100 ms.

You can save the values from clipboard to variable by this command:

unit=%Clipboard%
Which is better if you want to work with loops. You need not to access Clipboard many times for same value, to you save it to variable name unit and they you can use it in a loop.

For example this loop

Loop, 8
{
}
Will do the commands in brackets 8 times (for 8 players). There is variable in the loop called A_index and it keeps actual value of the cycle.

Sendinput command sends keystrokes on keyboard, but if you want to type for example "Elite Jaguar" in the select box during editing of effect or condition, you must use Sendraw.

So I use

Sendraw %unit%

To type the name of unit in the select box and find it. It types the value saved in variable with name "unit".

If you have a command like Sendinput, you type in the brackets the name of hotkey you need. So e.g. in notepad:

SendInput {END}^+{LEFT}^c
Will send the cursor on endof line pressing key End and then pressing ctrl+shift+left it will select text. Ctrl+c will copy it into clipboard.

The most important to remember are these three hotkeys:
^ - ctrl
+ - shift
! - alt

If you type one of them, some next key in brackets {} must follow.
This site explains more:
http://www.autohotkey.com/docs/commands/Send.htm#SendInput

Yet two commands I use.

sleep, 100
To wait 100 miliseconds

sleep, 1500
to wait longer If I want to see what happens or

msgBox, %unit%
to see if the value was saved in Clipboard. msgBox will pause the AHK script until you click button OK, and that is very useful to break your script to find mistakes or to check correctness of your code.

My example of using AHK in TS:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#s::
SetKeyDelay, 50

WinActivate,HP numbers 2.txt
SendInput ^{HOME}

loop, 4
{
WinActivate,HP numbers.txt
SendInput {DOWN}{END}^{LEFT}{LEFT}{SHIFT DOWN}{HOME}^{RIGHT}{SHIFT UP}^c
sleep 100
unit=%Clipboard%
SendInput {END}^+{LEFT}^c
number=%Clipboard%
sleep 100

WinActivate,AOK Trigger Studio
; #1
SendInput {NumPadAdd}e{ENTER}+{TAB 4}
SendRaw %unit%
SendInput {ENTER}
sleep, 100

; #2
SendInput e{DEL}
sleep, 100

; #3
SendInput {ENTER}+{TAB 1}-%number%
SendInput +{TAB 3}
SendRaw %unit%
SendInput {ENTER}

; #4
SendInput e{ENTER}+{TAB 1}%number%
SendInput +{TAB 3}
SendRaw %unit%
SendInput {ENTER}{DOWN}
msgBox, 1
}

return

A notepad window with this text I have open:

civelite unitnumber
azElite Jaguar16777141
britElite Longbowman16777176
byzElite Cataphract16777066
celtElite Woad Raider16777136
franElite Throwing Axeman16777156
gothElite Huskarl16777146
hunElite Tarkan16777066
chinElite Chu-ko-nu16777166
japElite Samurai16777136
korElite War Wagon16777016
mayElite Plumed Archer16777151
monElite Mangudai16777156
persElite War Elephant16776616
sarElite Mameluk16777136
spaElite Conq16777156
teutElite Teutonic Knight16777116
turkElite Janissary16777176
vikElite Berserk16777156
allScorpion16777176
allHeavy Scorpion16777166
allLight Cavalry16777156
allHussar16777141
allKnight16777116
allCavalier16777096
allPaladin16777056
allCamel16777116
allHeavy Camel16777096
allCavalry Archer16777166
allHeavy Cavalry Archer16777156
allArcher16777186
allCrossbowman16777181
allHand Cannoneer16777181
allEagle Warrior16777166
allPikeman16777161
allHaldarbier16777156
allLong Swordsman16777161
allTwo Handed Swordsman16777156
allChampion16777146
allMan-at-Arms16777171
(columns divided by tabs; I don't know why but this site shows the columns joined into one column! there are tabs between "civ","elite unit","number" columns)

And in AOK TS 1.0.1 I have triggers which each contains two conditions and 4 effects with damage effect. The players are already set.

First I activate notepad Window and get Unit name and HP number. Saved in variables %unit% and %number%.

Then I activate the TS window, I open the trigger by numpad + and press e to select effect. I press enter (This is under the comment line:; #1). I select the unit because I type the name of it and press enter to confirm.

#2 I delete next trigger

#3 I edit next condition and paste negative number into resource and select the correct unit. I pause the script to check it and then continue. I can remove the msgBox to speed up whole process.

#4 In the last damage effect I insert positive value and edit the unit name.

I run these command very fast for 4 loops so there will be 4 triggers with 4 different units. I can do it similar for all lines of the notepad (40 units/triggers).

This script is very short, but I write it about hour, so save much more time. Other script take about 15-30 minutes and it saves at least one week of hard work.

[This message has been edited by rumburak24 (edited 08-01-2012 @ 04:43 AM).]

Replies:
posted 07-28-12 05:52 PM CT (US)     1 / 26  
It is also possible to work which functions which helps to shorten code.

I have made update for the script above using funcitons. I have change it. So instead changing effects of triggers I 3x copy the effect that I have changed and edit it. So now all 40 units (120 effects) are in one trigger. This takes about minute. And because I want to do 32 triggers for 8 players, it saves quite much of time:


#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

get_values(txt_document){
global unit
global number
IfWinNotExist, %txt_document%
{
msgBox,Txt document not opened, stop the script
}
WinActivate,%txt_document%
SendInput {DOWN}{END}^{LEFT}{LEFT}{SHIFT DOWN}{HOME}^{RIGHT}{SHIFT UP}^c
sleep 100
unit=%Clipboard%
SendInput {END}^+{LEFT}^c
number=%Clipboard%
sleep 100
}

four_triggers_edit(delete=1){
global unit
global number
WinActivate,AOK Trigger Studio

; #1
SendInput {ENTER}+{TAB 2}
SendInput {HOME}+{TAB 2}
SendRaw %unit%
sleep, 100
SendInput {ENTER}

; #2
if (delete = 1)
{
SendInput e{DEL}
sleep, 100
}
else
{
SendInput e
}

; #3
SendInput {ENTER}+{TAB 1}-%number%
SendInput +{TAB 1}{HOME}
SendInput +{TAB 2}
SendRaw %unit%
sleep, 100
SendInput {ENTER}

; #4
SendInput e{ENTER}+{TAB 1}%number%
SendInput +{TAB 1}{HOME}
SendInput +{TAB 2}
SendRaw %unit%
sleep, 100
SendInput {ENTER}
}


#s::
SetKeyDelay, 50

txt_document = HP numbers 2.txt
WinActivate,%txt_document%
SendInput ^{HOME}

get_values(txt_document)
WinActivate,AOK Trigger Studio
SendInput {NumPadAdd}e ; Find first effect
four_triggers_edit()

; COPY/PASTE EFFECTS AND 39x repeat the job
loop, 39
{
sendInput {UP 2}^c
sleep, 250
sendInput {DOWN 2}

loop, 3 ; paste 3 new effects
{
sendInput ^v
sleep, 250
}
sendInput {UP 2}
; Here the edit starts again:
get_values(txt_document)
four_triggers_edit(0)
}

return

I just open the txt document, TS and scenario and press in+s hotkey to do the job.


Now yet to show you more, this code changes 8 deactivation effects to activate:

Loop, 8
{
SendInput {NumpadAdd}e
SendInput {ENTER}{UP}N{ENTER}{DOWN}
}




This renamed my triggers called "ark attack ... " to "heal ...":

loop, 8
{
loop, 4
{
SendInput {F2}{HOME}^{RIGHT 2}{LEFT}^+{LEFT 2}
SendInput Heal{ENTER}{DOWN}
}
}


This turns 8 triggers on or off:

loop, 8
{
SendInput {TAB}{SPACE}+{TAB}{DOWN}
}


This changes 8 trigger loops on or off:

Loop,8
{
SendInput {TAB 2}{SPACE}+{TAB 2}{DOWN}
}


This does copy paste between TS windows:

clipboard := ""
SendInput ^c ;save
sleep 1000
SendInput !{TAB}
sleep 250
SendInput ^v
sleep 1000
SendInput !{TAB}
SendInput {DOWN}
Used in TS 1.0 to copy triggers, effects or conditions.

[This message has been edited by rumburak24 (edited 08-01-2012 @ 04:40 AM).]

posted 08-03-12 11:51 AM CT (US)     2 / 26  
This one is also very handy:


#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#s::
SetKeyDelay, 50
loop,8
{
SendInput {NumpadAdd}c{ENTER}{TAB 6}
SendInput {TAB 1}39
SendInput {TAB 1}93
SendInput {TAB 1}37
SendInput {TAB 1}91
SendInput {ENTER}
SendInput {UP}{NumpadSub}{DOWN}
}

SendInput {DOWN}

loop,8
{
clipboard := "-"
SendInput {NumpadAdd}c{ENTER}{TAB 6}
SendInput {TAB 1}59
SendInput {TAB 1}92
SendInput {TAB 1}57
SendInput {TAB 1}90
SendInput {ENTER}
SendInput {UP}{NumpadSub}{DOWN}
}

SendInput {DOWN}

loop,8
{
SendInput {NumpadAdd}c{ENTER}{TAB 6}
SendInput {TAB 1}93
SendInput {TAB 1}70
SendInput {TAB 1}91
SendInput {TAB 1}68
SendInput {ENTER}
SendInput {UP}{NumpadSub}{DOWN}
}

SendInput {DOWN}

loop,8
{
SendInput {NumpadAdd}c{ENTER}{TAB 6}
SendInput {TAB 1}96
SendInput {TAB 1}47
SendInput {TAB 1}94
SendInput {TAB 1}45
SendInput {ENTER}
SendInput {UP}{NumpadSub}{DOWN}
}

SendInput {DOWN}

loop,8
{
clipboard := "-"
SendInput {NumpadAdd}c{ENTER}{TAB 6}
SendInput {TAB 1}68
SendInput {TAB 1}58
SendInput {TAB 1}66
SendInput {TAB 1}56
SendInput {ENTER}
SendInput {UP}{NumpadSub}{DOWN}
}

SendInput {DOWN}

SetKeyDelay, 50
loop,8
{
SendInput {NumpadAdd}c{ENTER}{TAB 6}
SendInput {TAB 1}47
SendInput {TAB 1}80
SendInput {TAB 1}45
SendInput {TAB 1}78
SendInput {ENTER}
SendInput {UP}{NumpadSub}{DOWN}
}

return

I've just needed to correct areas in Condition Objects in Area. So this runs 7x8 batch of commands (keystrokes series) to expand the trigger, select first condition, open the edit window of it, and fill the values for area. I took just 5 minutes and was done so fast that I could not to anything.

You can regulate speed of keystrokes by the command SetKeyDelay, 50 or SetKeyDelay, 30 or SetKeyDelay, 20 or to fit it to your needs.

[This message has been edited by rumburak24 (edited 08-03-2012 @ 11:52 AM).]

posted 08-06-12 09:48 AM CT (US)     3 / 26  
This scripts moves trigger from one area to another area in trigger list:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; TS 1.0.1 (not tested on TS 1.0)

FindTarget(){
; Find trigger:M - Water & Mountain design
; and go up to: rem c8
SendInput {HOME}Q{DOWN}X{DOWN}M{UP}
}
FindSource(){
SetKeyDelay, 100
SendInput {HOME}Magic
SendInput {DOWN}celts
SetKeyDelay, 20
}
Cut(){
SendInput ^x
sleep,200
}
Paste(){
SendInput ^v
sleep,200
}

^a::
FindSource()
Cut()
FindTarget()
Paste()
return

esc::exitapp

I just want to show you how much the AHK is practical for use in TS.

[This message has been edited by rumburak24 (edited 08-06-2012 @ 10:33 AM).]

posted 08-06-12 11:20 AM CT (US)     4 / 26  
It seems practical, except you need to know the language it's written in to be able to use it handy
posted 08-06-12 11:37 AM CT (US)     5 / 26  
Basse, the language is very easy. I personally learned to use it in few days. You can ask on forum of AHK, they are pleasant to help. The basic is that the script defines shortcuts that you can use to do some job (pressing of keys or clicking, mouse dragging, etc.).

Win key problem
During my work with AHK I stucked one problem with Win key, which frustrated me a lot. If you want to prevent this to happen to you, rather use ctrl+a shortcut for TS.

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
SendInput {lwin UP}

; ctrl+a fires the script
^a::
sendInput Hi{SPACE}Basse
return

If U use win+hotkey, sendinput command can frustrate some users who use Windows. There is some problem that if U use win+hotkey, the program can "freeze" the Win key, like it is pressed (and not released). This is described as a "feature" and what I found till now, it is cause by commands
send, sendinput or sendraw, if you use win+hotkey.

However if you want to use the Win+hotkey still, you can use different command that should not make troubles!

Try

#b::
sendPlay Hi{SPACE}Basse
return

Press win+b . This will type Hi Basse in your editor (if you had open a document).

I would recommand to replace the SendInput by SendPlay to prevend this problem.

C more:
http://www.autohotkey.com/community/viewtopic.php?f=3&t=80725

[This message has been edited by rumburak24 (edited 08-06-2012 @ 11:52 AM).]

posted 08-07-12 08:47 AM CT (US)     6 / 26  
For case, that you would like to create scenario objects like terrain with triggers, you could use this clever script.


It can copy Units coordinates, from Units tab into notepad document (or any other you want).

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

txt_document = palms and cliffs 2.txt

#s::
SetKeyDelay, 50

; Select TS, Units tab, and click your object in the list.
WinActivate,AOK Trigger Studio
SendPlay {TAB}^c
sleep 200
x = %clipboard%
SendPlay {TAB}^c
sleep 200
y = %clipboard%
SendPlay +{TAB 2}{DOWN}

WinActivate,%txt_document%
SendPlay Palm{TAB}%x%{TAB}%y%{ENTER}

return

I used SendPlay command instead of sendInput because I use Win key+hotkey.

And this is the result, which is made during 20 seconds:

Palm45.581.5
Palm46.581.5
Palm47.581.5
Palm46.582.5
Palm45.582.5
Palm46.583.5
Palm47.582.5
Palm44.581.5
Palm44.582.5
Palm45.583.5
Palm43.583.5
Palm43.582.5
Palm44.580.5
Palm43.584.5
Palm44.585.5
Palm45.584.5
Palm44.579.5
Palm43.581.5
Palm42.582.5
(The tabs between Palm and numbers are not vissible here.)


You could use loop to speed this up to cca 5 or 10 seconds but I see no sense for it in this script.

For case that you want to create Palms by triggers, now you can add this code and run it with win+d:

#d::
SetKeyDelay, 50

WinActivate,%txt_document%
SendPlay {HOME}^{RIGHT}^+{RIGHT}^c
sleep 200
x = %clipboard%
sleep 200
SendPlay {RIGHT}{LEFT}^+{RIGHT}^c
sleep 200
y = %clipboard%
sleep 200
SendPlay {HOME}{DOWN}

WinActivate,AOK Trigger Studio
SendPlay {TAB 7}{ENTER}{ENTER}cca
SendPlay {TAB 3}{DOWN}
SendPlay {TAB 1}%x%
SendPlay {TAB 1}%y%
SendPlay {TAB 2}
SendRaw Forest, Palm
SendPlay {ENTER}
return

The actions to create new effect Create Objects are less reliable. There for I don't use loops here, and occasionally check if the effect is created correctly. You must set cursor on the correct line before coping of the numbers can start.

Now it's pretty easy to create terrain by triggers.

Note: It would be even possible to get value of Rotation or Unit Constant, but this one is little more harder.

[This message has been edited by rumburak24 (edited 08-07-2012 @ 09:28 AM).]

posted 08-08-12 04:28 PM CT (US)     7 / 26  
Do you know that you can compile the script to .exe file so it could be simple to run by anybody who would like to use your script? It could be possible (and not much hard) to write little programs with GUI, which would help to scenario designers to do the job. The Graphic interface can be used, for example to offer information about the script and inputs to specify your task. Now I would like to write simple script to copy cliffs or any other units from Units tab with the Rotation information. So for example, you could specify in the GUI name of your document and what values you want to copy (id, name, x, y, rotation, frame and garrison). So you could speed up the copy process. It would be simple for anybody just run the program, read the intro. information and to do the job with the program.

I just think about something what I miss in TS. There is not possibility to change object ID or to insert value of ID of the object that you want to select. So, even if you would have your object IDs in the txt document, you cannot simply do AHK script to select objects by IDs, because TS does not support this feature. But would be great if some programmer could to make some additional development of the controls to TS 1.0.1 to support this.

After I solved the Win key&SendInput problem, I really started to love AHK, this little programs saves lot of hard work.

[This message has been edited by rumburak24 (edited 08-08-2012 @ 04:31 PM).]

posted 08-12-12 10:19 AM CT (US)     8 / 26  
I have decided to make more advanced programs .exe that you can run and find benefit in work with AOK TS. I will call these programs scripts, so the name for all these programs will be AOKTSS (Scripts for AOK Trigger Studio). You should find the programs are simple to use. Right now I am trying to complete first of these programs which can serve to copy object information.

What you can do with it:

You can for example create cliffs in scenario, then save the scenario and open it in TS. Create new TXT document in notepad. Click on Unit tab in AOKTS. Run the program.

You can either copy all object information, or select what object you want to copy (capture). For example. I will enter cliff as Unit name, and I will select 10th item in the list. Then the program will start to go from the 10th cliff and copy all cliffs or if I specify count if items, so it will copy only 10 items for example. You can also change x,y position of the object (not tested yet). Either relativly or absolutely.

In the next development I will do feature to set your objects according your table (notepad document). So you will specify which object you want to set, and you will apply your table settings to it.

Test and write feedback. This is only one program, but I would like to write more programs e.g. for activating and deactivating triggers, selecting of units in condition or effects, changing cond./eff. properties in a group of triggers and make program to garrison units (invisible cloak).

Merit of these programs
The main advantage is high reliability and high performance. These programs will use different approach then in the scripts above. It will directly access controls (inputs) of the AOK TS windows and get data from it or set data in there. This is not like simulation of pressing keys on keyboard which is slower and less reliable!

[This message has been edited by rumburak24 (edited 08-23-2012 @ 08:18 AM).]

posted 08-23-12 07:50 AM CT (US)     9 / 26  
Announcement: Program released
AOKTSS Objects released!
https://sourceforge.net/projects/aoktss/files/



I hope you will not find any bug but if yes, tell me.

At this point, you can do a lot with information with unit (objects) properties, you can copy them, change X or Y axis, set different unit constant (unit name).

help file here:
https://sourceforge.net/p/aoktss/wiki/Home/
update: hotkey win+r to reload program added

Question
1) Do you know how to create video tutorial (and to upload it somewhere) - if you want to help, learn the program and do that for the program, because - even there is help in the program, I am not sure if users will not be lazy to read it.
2) Do you know some better site instead free4share.com to upload scenarios (except blacksmith)? free4share.com aborted my account recently

Next script which I would like to create is program to create units by trigger from your txt table.

[This message has been edited by rumburak24 (edited 08-23-2012 @ 09:36 AM).]

posted 08-24-12 00:43 AM CT (US)     10 / 26  
Hi rumburak24 again, very very kewl! I used to use this program but have long since forgotten the method and coding skills! :/
Question
1) Do you know how to create video tutorial (and to upload it somewhere) - if you want to help, learn the program and do that for the program, because - even there is help in the program, I am not sure if users will not be lazy to read it.
2) Do you know some better site instead free4share.com to upload scenarios (except blacksmith)? free4share.com aborted my account recently
A(1) Well, Id love too, as like I said I used to use that AHK alot but have since forgotten but basically Ive had no luck getting video or screen capture programs to work well for me
A(2) Mediafire -I still use that, but I lost my original old docs I had on it from back 4 years, so I believe they will delete your account if your inactive for over 2 years or something.

Keep up this great idea of AHK advancing editing capabilities for AoK! Havnt noticed anyone else thinking of utilizing this awesome program before for games.

~Ms. Ravishing.

I am a redhead that loves to mod games. I love artwork, pixel art, creating or editing images of all kinds.
Peek Here
posted 02-23-13 06:22 AM CT (US)     11 / 26  
Script to copy coordinates from one window to another:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#s::

SetKeyDelay, 50

SetTitleMatchMode, RegEx

; prepare target window
WinActivate,H278
SendInput {ENTER}{TAB 6}

; prepare source window
WinActivate,Condition
;SendInput {TAB 7}

; go through all 4 fields of area
loop, 4 ;<-- loop 8 players
{
clipboard := ""
SendInput {HOME}^+{RIGHT}^c{RIGHT}{LEFT}
sleep 250
; msgBox clip:%clipboard%

SendInput !{TAB}
SendInput ^a%clipboard%
sleep 200
SendInput {TAB}

SendInput !{TAB}{TAB}
}

; Back to 1st field of source
SendInput +{TAB 4}

; Finished. Activating target window
WinActivate,H278
WinActivate,Effect

Image here:
http://i48.tinypic.com/2zsw4sw.png

It copied coordinates from Condition window (you can change to effect Window if You would type Effect, but then you would need to change
WinActivate,Effect
to
SendInput {TAB}
which will switch you to the next window (which is the same as previous one, coz I switch only two windows)) to the Effect Window which opens automatically.

You must do only this:
Open two windows. In one you have your target, in the second on right the source. Then you select target effect. Then you select source condition and click on first filed of area. Then you run the script (autohotkey-L installed). Then you press win+s hotkey.

You also need to rename WinActivate,... to some title in your windows to find the Window. Or increase delay (sleep [ms]) time for clipboard operations.

Remember, if somethings wrong, check windows titles. If for example you have more windows with same title opened like "Condition" or "Effect", it will cause that your script will not work as you would expect. It will send the keystrokes to different window! Then you got fails like, effect window did not open, cursor in Condition window did not get back to 1st field, or even different condition was choosed or crazy things your script does. In the two last cases never save your scenario, but load backup and check titles again.

[This message has been edited by rumburak24 (edited 02-23-2013 @ 07:16 AM).]

posted 03-01-13 08:21 AM CT (US)     12 / 26  
Last days I am starting with classes in Autohotkey. This should make the program more pro. I need classes because want to extend the program later so that you will can create any condition and effect very simply and not only once, but for all players. It would be able to activate the triggers too. This way it would be simple to create triggers for bonuses or for some kind of penalties. Make computer detection system or diplomacy detection system very simply. You would just define where you would want to create your objects so make signal and then the rest would be done by program.

It could also be able to record the effects and conditions which you have in triggers (very simpl) into txt file, which you could use to create exactly the same thing in you scenario.

But now, I would like to start with something very simple: to capture the properties of destroy condition (Player and Unit id) and with Object in area condition, which would be very good also to define which players object lies where... This way wanna make the things with triggers.

Also I'm thinking about better name for AOKTSS, maybe Auto-AOKTS? or AHK-AOKTS (Shortcut A-AOKTS). Or maybe even Auto-TS would be great name, don't you thing? Even ATS would sound good!

[This message has been edited by rumburak24 (edited 03-01-2013 @ 08:26 AM).]

posted 03-08-13 11:51 AM CT (US)     13 / 26  
Well, new project name started and program renamed to ATS.

https://sourceforge.net/projects/autots/

I have improved some parts of the program, functions, which guarantee reliability of the program and speed.

I could do some demo video but it will be without sound, so if anybody wants to make tutorial video for the upcoming program you are welcome.

What it does in the moment? I can automatically generate Create effects and triggers for players as specified. I will then continue on next programs and versions to make it more useful.

[This message has been edited by rumburak24 (edited 03-08-2013 @ 11:55 AM).]

posted 04-08-13 04:01 PM CT (US)     14 / 26  
Download the ATS Objects Arranger program, and do invisible cloaking and other things to save time with scenario:

https://sourceforge.net/projects/autots/files/

And please report if you find some grammatical mistakes in help when you will read it. Or if some things are not clear type me how to type it more clear.

[This message has been edited by rumburak24 (edited 04-21-2013 @ 03:39 AM).]

posted 04-15-13 02:38 AM CT (US)     15 / 26  
I forgot to send photo of the ATS Objects Arranger:



Guys. I see you don't download the program, but you should do. You'll find it very useful later when I will do next programs and advanced ATS. This little program calles ATS Objects Arranger create table ob objects values from Units tab in AOKTS. It can set or change objects values, which is very usable for creation of objects by Create trigger(s)/Create effects, for invisible cloaking, for making order of objects in scenario (needed to be order if you would like use ATS later). You should just see and try.

The new version of ATS Objects Arranger contains detection or diagnosis (hotkey win+d) which can make statistics about how many units/objects you filtered. This is important because when you will set values or create invisible cloaking or when you will make Create triggers/Create effects for unlimited resources you must specify how many items/lines is in the source TXT table.

[This message has been edited by rumburak24 (edited 04-21-2013 @ 03:40 AM).]

posted 04-15-13 10:18 AM CT (US)     16 / 26  
I have downloaded it, but I don't really understand how it works. What do I put in the .txt file?
posted 04-17-13 03:03 AM CT (US)     17 / 26  
Thanks for downloading. Did you read help? I'm not sure if I miss something there.

In the "txt file" will be table in TXT format. This is file, where every column is saparated by one tab. In the moment when we start, we have no file yet. You don't need file if you don't wish to save it for later use. You have just empty editor window opened, and AOKTS v 1.0.1 opened.

I expect your Editor window is named like so:
"Notepad - noname" . If yes. So first what you do is:
1) Make sure that any ATS program does not run in memory and that you have only one Window of AOKTS opened.
2) start ATS Objects Arranger\Step 1\ATS_Objects.exe
(new window form)
3) enter unique name of the Editor window
In the Txt Document or Title Window type:
Notepad - noname
... in the case that the window title begins on noname, you just type noname...
4) you don't need set anything, because the config file in this folder is pre-configurated.
5) open scenario
scenarios\babel_pers_done_invisible_cloak.scx
6) click on Units tab of AOKTS
7) select any item, which you wish to capture in the units lists of AOKTS.
8) Again click on Window "ATS Objects Arranger..."
9) Uncheck "Test only". Keep the slow checked if you wish to see the action performed slowly.
10) Press OK
11) Press hotkey
win+w to read&write data from Units tab
The txt table should be created now.
How many lines will be created depends on options "How many times"

If you wish to reload the program and see the form again, press win+r. Use this hotkey in the case that you started the action with Test option by incident. Reload will stop the actual process of ATS Objects Arranger, and will load new instance (will open new form).

PS: I'm not good on clarifing. Hope that helps (1st step).

Now added:
ATS_objects_help_video.avi Unfortunately the video is less quality and the main thing (colored rings in place where I clicked!) was not captured! (I clicked on few places to mark what text I fill in the form). In the video I replace 108 fishes Doredo for 108 fishes Marlin 1. It takes few seconds to take the capture and 28 seconds to set new names for these objects. But in the video it takes much longer because the recording program slowed down performance of my CPU!
The video is here:
http://sourceforge.net/projects/autots/files/ATS_objects_help_video.avi/download

[This message has been edited by rumburak24 (edited 04-21-2013 @ 03:40 AM).]

posted 04-19-13 05:11 AM CT (US)     18 / 26  
Few problems which you can hit with ATS Objects Arranger due to your inattention:

- if you start to read from txt table, but you forget to set cursor on begin of the line in TXT table, then it results in error message. Don't click OK button, but restart the program with win+r. I did not made it to exit or terminate program because I am used to continue when I debug possible errors.
- if you run command e.g. to read data from AOKTS, but it does read nothing, but it shows ATS Objects Arranger window instead (looks like ATS Objects Arranger to be be reloaded), check if you typed correct Filter name and if you selected correct item in AOKTS objects list to define where to start from.
- depending on your machine and system, maybe you will need to set some values in configuration file. The program needs some time to get data from clipboard or to save it to clipboard. This is saved under variable copyPasteSleep which is in config file by default copyPasteSleep=400. If you need bigger time to copy the data to clipboard or to read it, then try to increase this time in miliseconds.
- today (friday) I have made update which fixes one mistake in diagnostics and added sleep (timer) for test, which you can configurate in config file. By default
testSleep=750 in IO section. If you will type testSleep=3500 you will have 3.5 seconds to test every item (slow mode). I missed this when I was looking for 8 monuments in map in objects list which has 114000 items. And because it would be really crazy to list it manually, I used the filter function in test mode, with Slower checkbox checked. So when you view your map in AOKTS, you can see position of the object, where it is placed.

PS:
new version uploaded

[This message has been edited by rumburak24 (edited 04-21-2013 @ 03:41 AM).]

posted 04-19-13 09:54 AM CT (US)     19 / 26  
I still don't see any practical use for this? Is it to make several units invisible?
posted 04-19-13 10:18 AM CT (US)     20 / 26  
Practical use of ATS Objects Arranger

The program is needed to generate TXT table, which is a base for ATS (stands for AUTOMATE! Trigger Studio) program . When you have the TXT table, you can do many things with it. With ATS Objects Arranger you can do
1) search objects: you can use this utility to simply find objects in huge units list, this includes search by area or areas, search by unit type or unit class, or search units which are garrisoned inside some unit
2) save this results to file to be used to create triggers with ATS.
3) rename some objects names in the scenario (change Unit Constant). If you decide rename Wonders to Monuments, or Archers to LongBowman, you can do it very simply in Arranger.
4) replace objects, change position of the objects
5) garrison objects in some objects
6) rearrange objects in scenario (order the objects as you need to find them easy)
7) statistics - you can calculate how many objects of certain name you have in scenario and check if you placed them all

All these is useful if you have many units in scenario, but can be also used if you want to get coords for objects created by triggers.

There is also another program (not finished at the moment. because I have some bug there), I am still not sure if I will call Objects creator or Triggers Creator). This will also use TXT table and you can do such things like create inexhaustible resources. You can create almost every object by trigger and not to do it manually in AOKTS. There is many many many other use in future by ATS. But without understanding how to use this little utility, you will not know how to use TXT table or how to create it. The creation of TXT table is very simple. You need type Window title of notepad or other editor, uncheck test/slow options, check columns which you want to capture and then press hotkey win+w.

ad 1-3) steps which I use often when I want to make invisible cloaking.
ad 4) Why reorganize objects in scenario? Because when you have some objects already placed, but they are not in correct order, so they are lost in the long list of objects. I have such situation now. I have placed monuments in game, then edited forests. And then added next monuments. This leads to big chaos so when I wanted to do invisible cloaking for them, it would be slow work to do it manually. SO I used filtering and this enabled me to to the work by program, not to look for the objects.
ad 5) I found that I placed two monuments into different players and there for I had 6 monuments instead of 8. This found by diagnostic command win+d . So when you have incorrect number of objects when you wish to set them, it will not work correctly. Also if you have bad order objects it can be obstacle to create triggers automatically. So objects order minds - very important for ATS.

[This message has been edited by rumburak24 (edited 05-06-2013 @ 06:00 AM).]

posted 04-27-13 09:21 AM CT (US)     21 / 26  
I have created new video tutorial, in much more better image quality (10Mb). This tutorial shows how to search for objects in list of objects using ATS Objects Arranger*. It is very simple. * - I renamed ATS objects to ATS Objects Arranger.

http://sourceforge.net/projects/autots/files/video_search_in_ats_objects_arranger.avi/download

This method of search I use sometimes when manual leafing is too slow and unreliable.

Notice: I found mistake in original video, 1st part (not sure if this mistake is in the final video which I uploaded).

The correct hotkeys used in the video are:

This tutorials showed how to get data of objects from certain area, using hotkeys win+f - area filter; win+w - read data from Units tab to txt document; win+r - to reload program!)

[This message has been edited by rumburak24 (edited 04-29-2014 @ 07:40 AM).]

posted 04-30-13 11:19 AM CT (US)     22 / 26  
I'm proud to announce that I have created new great feature to ATS Objects Arranger. Now you can search for objects or filter results from the units lists by area.

http://sourceforge.net/projects/autots/files/ATS Objects Arranger.zip/download

It's simple (in the case that you already know how to use ATS Objects arranger). After you have set basic settings in main form and pressed OK, press win+f. Shortcut for filter or find. You type 4 points of area in which you want search object or objects. Then OK. Then select begin of AOKTS units list and then press win+f to find first item. Repeat to find next item. Or press win+w to read data. These data will be filtered, so only data from this area will be received to table. Table will be pasted to notepad document or any other editors window, as usually.

Use this feature commonly with filter (filter unit name) and save time for manual leafing.

Notice:
ATS Objects Arranger is program, originally called ATS Objects. Arranger is name which fits better and is better apposite.

Update - Actual news
I am working on remake of the actual version. I have found few bugs and realized I need to remake core. Actual concept was low performance. New version will be much more faster. I will offer more options to do extended searches by area(s) and/or by unit type or by class. You could search only for military units in certain area(s). There could be also possibility to order the results by unit name (maybe by unit type too)? I also added some commands to menu. I will need more time than just few days for this. I have also idea how to arrange results into groups, like in the cases that buildings or units in some areas are related to player 1, but those units are Gayas units.

[This message has been edited by rumburak24 (edited 05-05-2013 @ 08:09 AM).]

posted 09-09-13 07:56 AM CT (US)     23 / 26  
Updates and tutorials:

I am again in programming, removing some old bugs and adding new little features, which would make the program more usable. So here the idea to import whole list of units. Also got idea how to enable to filter units according terrain on which it is placed. For example, you could get list of ships which are placed on water, or any buildings placed on desert...

Notice: there is a tutorial for older version (spring 2013?) of ATS Arranger here:
http://sourceforge.net/projects/autots/files/video_search_in_ats_objects_arranger.avi/download
I even found two more tutorials which I forgot to upload, they are 2 parts of how to filter units by area in ATS Arranger:
I did not succeed to join them and convert them to have less size. Maybe somebody of you guys could succeed?
http://sourceforge.net/projects/autots/files/Haystacks VIDEO TUTORIAL part 1-2.zip/download

All these tutorials are very basic. They don't show how to manipulate with the coordinates or attributes of units/objects, but this will be my next goal when the ATS Arrange will be stable.

[This message has been edited by rumburak24 (edited 09-09-2013 @ 07:57 AM).]

posted 04-26-14 02:10 AM CT (US)     24 / 26  
Long time I did not programme with AHK. I am working on some long time php project at least for this year. It would be nice if I could finish this project in future.

But in the case, that I won't. There is still the program ATS arranger finished (99.8%). You can use it.

I actually work on Arena v4 scenario for 4 players and I created triggers to it. Then I copied the scenario and made it to be Black Forest v4, based on the original version. Then I finished with 4 different copies. Now I have to change some objects position to make the map to be more balanced!!! What can I do? I some did changes to one scenario. Now I copy the positions of certain units: deers, boars, forage bushes and I will simply change the positions of these units in the others scenarios automatically. So I will have same positions for all units. This takes few minutes just because I need to check carefully what I do, but it is made automatically.

You want to know how to do it? Visit my developer's page on Soureforge for ATS and look for ATS arranger (it was called AOKTSS originally.).

So after I captured the positions I have these records in unnamed file (Czech: Bez názvu) - note: I have made note there to add count of items (16x, 8x, etc. to remember them)
(oops, tab removed, so click here: http://justpaste.it/edit/4298352/3aa1bd6f)

16x
24211Deer138.59.50/43-1
24212Deer135.511.55/41-1
24213Deer135.59.52/44-1
24214Deer182.5172.51/42-1
24215Deer182.5170.50/40-1
24216Deer180.5172.55/42-1
24217Deer180.5174.52/40-1
24222Deer7.599.52/44-1
24223Deer8.599.50/42-1
24224Deer9.5101.52/44-1
24225Deer8.5100.52/43-1
25273Deer137.58.52/40-1
25274Deer61.5202.56/40-1
25275Deer64.5202.51/43-1
25276Deer62.5203.51/44-1
25277Deer63.5201.54/41-1

8x
24227Boar153.5161.52/45-1
24228Boar82.5156.56/48-1
24229Boar17.578.54/45-1
24230Boar148.510.56/49-1
24232Boar74.5194.51/49-1
24233Boar54.572.52/43-1
24702Boar171.5171.52/47-1
25286Boar130.551.50/43-1


48x
24179Sheep152.536.55/43-1
24180Sheep148.539.55/43-1
24181Sheep149.537.54/46-1
24182Sheep151.539.54/41-1
24183Sheep164.5140.50/40-1
24184Sheep163.5140.52/45-1
24185Sheep164.5141.56/45-1
24186Sheep163.5142.51/43-1
24187Sheep65.5171.51/43-1
24188Sheep68.5168.54/45-1
24189Sheep63.5170.55/47-1
24190Sheep66.5167.56/42-1
24191Sheep40.567.54/45-1
24192Sheep38.567.54/41-1
24193Sheep37.568.54/42-1
24194Sheep39.567.55/46-1
24195Sheep163.59.52/43-1
24196Sheep159.510.52/40-1
24197Sheep159.554.56/45-1
24198Sheep159.555.56/41-1
24199Sheep115.5102.54/43-1
24201Sheep150.5175.52/48-1
24202Sheep151.5173.51/44-1
24203Sheep54.5188.54/47-1
24204Sheep53.5187.52/46-1
24205Sheep53.5158.54/40-1
24206Sheep51.5161.52/46-1
24207Sheep13.5103.54/43-1
24208Sheep17.5103.55/40-1
24209Sheep53.560.52/41-1
24210Sheep55.558.52/43-1
25343Sheep192.5182.50/48-1
25344Sheep193.5181.55/43-1
25401Sheep89.5107.51/45-1
25402Sheep145.5105.52/45-1


http://oi59.tinypic.com/2aieivs.jpg

Finally I change the positions of objects in the different scenario: warning! I just found I have did mistake! You should not use the "by ID" checkbox, unless you are 100% sure that the units which has these IDs are the same as in your previous map!


http://oi59.tinypic.com/34zk51i.jpg

You also may wonder how to re-open the submitted window. This is made with win+r (reload) hotkey
Keep attantion: Never have two same name windows opened. You can have open only one AOKTS and one document which you specified and which will be searched. Never run/start the ATS Object arranger more times, until you close the program from memory. You need only one program in the memory.

One more important note: the purpose of "by ID" checkbox is not only setting values in AOKTS, but also for search items by ID! So once you have finished setting values, set it back to unset. Why? Because if you will try to capture items/units from AOKTS and you will have the ID enabled it will produce error with errorlevel 1. This is because it will try to look for ID of specified items, that means those items which you want to capture not by name, but by ID (honestly I don't remember if this feature works or not, but you should need to have you cursor set on begin of txt table). Just don't use it if you don't needed.



http://oi61.tinypic.com/123kxs5.jpg

[This message has been edited by rumburak24 (edited 04-26-2014 @ 10:50 AM).]

posted 04-28-14 05:00 AM CT (US)     25 / 26  
Hi there. I come with great news.

I have finally learned how to use library treeview for ahk. This is very crucial to use ahk for Trigger Studio to control triggers automatically.

Did you not installed ahk-l? AHK L is version to run this script on you PC. Try it now! --> Google it, download and install it before you continue.

Update: I have update the main script to advanced level. But I have accidentally did not copy of the original scenario (sorry for that). Use the basic version of the scenario for noobs. You must first duplicate the items for 4 players in AOKTS. Then you can test my script.

Here is link of the Treeview library, there is also example scripts and my scripts for aokts. In the update archive, I have also added compiled files. You can run them if you have now AHK installed, but I recommend you to check the ahk scripts to know what I do in the scripts. Still it's best to have AHK installed and run AHK. You can edit the scripts to your need, for example the delays (sleep command).

The files Black_Forest_v4_noobs.scx and Arena_v4_noobs.scx are finished files to check. Check the second "Send message" effect for p2 - p4.

http://sourceforge.net/projects/autots/files/ahk treeview + change color of player in trigger (script+exe) + my scenarios.zip/download

Now I will explain what to do. If you installed AHK (L version!), start the script in files:
- either "aokts - change chat color - first try.ahk"
this is very basic simplified version
- or start the advanced version "aokts - change chat color - main.ahk"

Now id does nothing until you hit hotkey.
The first script will try to open window with "send chat" item and close it.

The second script will rename the "send cha" effect to send colored messages. In the scenario I used color, but I want to skip first trigger (p1) and rename p2 to , p3 to ,p4 to .

If I would have 8 players, I could continue to do this until p8. Very simple. In the main script there are lines:


Colors = RED,GREEN,YELLOW
Loop, parse, Colors, `,
{
some code
}
Which sets variable Colors to RED,GREEN and BLUE, separated by ,. It will parse the variable and process every one color in the edit box. So if you change the list, it will type different colors or change colors to more players. If you change the script while it is still running, you need to reload it manually or with hotkey win+r.

Now when I explained. Do you want to start the script? Select trigged named "0:00". And press win+s to start the script. That's all.

Update:
Update which I have done. Now you can use hotkey win+numpadn where n stands for number from 0 to 9. Again. Check the script lines 22 - 50. This will start action. If you press win+numpad3 or win+s it will jump to third sub-item. Yes, you must on which position the send chat is placed. So if it is on 3td position. press win+3. If it is on 4th position press win+4 and so on. I have added delay for first item so you can see where the program will start. Otherwise it would run very fast. I have also added auto-collapse so if you forget to collapse the p1 which is skipped, it will not cause any problem. I will collapse it by the script.

Update:
If you need to stop action started by hotkey, press win+r - this will mediately stop and reload program.

[This message has been edited by rumburak24 (edited 04-29-2014 @ 05:12 AM).]

posted 04-28-14 09:14 AM CT (US)     26 / 26  
Script updated + compiled version added and finished scenarios added. There was a bug in the previous version, so when you pressed again win+s it failed to expand. I have corrected it. New version uses hotkey win+numpad keyborad number to jump to nth sub-item in the trigger.

I will probably do one more advanced version to have auto-detection of the send chat. I need just to check if the item contains E: Send chat .


(update - notice: image corrected, there was a mistake; press win+numpad2)

For the case that it is on third position you can press either win+3 or wins+s. The third position is the most often used in this scenario.

In future I would like to do some more little programs, but the main program to generate triggers would be harder and am not sure if I will really have time to do it. But if so, you still need to know the basic program ATS Objects Arranger because using advanced program for triggers, without knowing how the simpler version works would be similar like to let you drive a car without any knowledge about car and traffic rules or even not to know how to get a gas to car. You would simply not manage without knowing ATS Object Arranger. Let me to remind you that there exists two video tutorials for it, check them: http://sourceforge.net/projects/autots/files (This tutorials showed how to get data of objects from certain area, using hotkeys win+f - area filter; win+w - read data from Units tab to txt document; win+r - to reload program!)

[This message has been edited by rumburak24 (edited 04-29-2014 @ 07:35 AM).]

Age of Kings Heaven » Forums » Scenario Design and Discussion » How to save time with AOK Trigger Studio
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames