Make maps with PHP SCX Editor

 syssouffle


Отредактировано12 de ������ de 2016 - 19:47syssouffle
PHP SCX Editor

PHP SCX Editor is a powerful tool / framework to edit aoc scenarios with PHP programming language. If you handle it you could make anything very easily. It's A LOT more powerful than aokts, you have the ability to build your own editor fonctionnalities very easily and organize your scenario how you want. That is very accessible to people who like programming and know it already a little bit. For others, you can still try it, programming is an intuitive skill and can be innate ! You could love it as you could hate it, it depends of people. Aoc triggers is a crap programming language which is boring and quite repetitive, if you can like that, you will love to practice a real programming language like PHP that allows you to build anything faster and smarter.

Don't be scared about complexity, the functions that are available are very intuitive and easy to use. It's much more smooth than an UI, but it takes more time to handle that, of course. When you'll handle the script you will have more time to think to your scenario instead of writing triggers, you could create fast almost whatever you think, and modify result very easily. You can message me, if you are motivated I will help you by Skype.

Features:
- Design scenarios how you want with PHP programmation. You can build them in smoother and faster ways, no more boring repetive tasks.
- Use ready to use simple and intuitive functions to read / write scenarios properties and write triggers.
- Use conditions, loops and any classic programming feature to generate triggers or anything in a scenario.
- Create complex custom conditions / effects / triggers sequence / macros.
- Assign any fields to values calculated by algorithm and variables.
- Copy paste triggers or any reusable code in new scenarios.
- Have a great overview of your triggers and your whole scenario in a single page.
- Build your own aoc editor framework to fill your needs.
- Modify your scenario by changing variables, no more need to edit triggers one per one.
- Change triggers order as you want, just cut paste code.
- Scenarios that would need 100 hours to make could need only 10 hours now !
- And more...!

Potential example: Making all CBA spawns with tasks for 8 players would need 12 lines of code:
Code:
$spawns = array(array(22,48),array(22,52),array(22,55),array(22,59)); $meetPoint = AreaPlayers(array(29,53)); Trig("Research Civ Techs"); foreach(range(1,8) as $p)foreach(LIB::$CivTechs as $tech)Efft_Research($p,$tech); foreach(range(1,8) as $p)foreach(LIB::$CivTechs as $civ => $tech){ Trig("Spawn Player $p - Civ $civ",1,1); Cond_Researched($p,$tech); Cond_Timer(4); Cond_NotOwnY($p,Y_MILITARY,40); foreach($spawns as $L)Efft_Create($p,LIB::$CivEliteUnit[$civ],AreaPlayer($p,$L));} Trig("Tasks",1,1); foreach(range(1,8) as $p)foreach($spawns as $L)Efft_TaskO($p,AreaPlayer($p,$L),$meetPoint[$p]);

More informations / Tutorial here:
[You must login to view link]

Download link:
[You must login to view link]
Ссылка | Ответить | Цитата
 SeriousMan


Размещено11 de ������ de 2014 - 21:08
Boy, I wish I had this back when I had the desire to make maps.
Ссылка | Ответить | Цитата
 23RaidingParty


Размещено11 de ������ de 2014 - 22:37
cool

but I thought SCX files were compressed, how did you manage to know its compression algorithm and decompress the files to allow them to be scripted in text?
Ссылка | Ответить | Цитата
 [MM]Gallas


Отредактировано12 de ������ de 2014 - 00:11[MM]Gallas
Thanks for posting this (pinned and wrote tutorial here too in "Voobly style"). Will suggest for new editors this way too.
Ссылка | Ответить | Цитата
 syssouffle


Отредактировано12 de ������ de 2014 - 12:43syssouffle
Thanks gallas for the nice edit.

Suicide i'm not the expert to explain you that, the decompression function has been written by AOHH. He mainly used the function unpack which read progressively a .scx from its first bit to its last bit. DiGiT made a documentation which tell you how is compressed the scx format.

Then it store data read in a variable, after editing the variable the script do exactly the same process than decompression but in the other direction with pack function, from your variable.
Ссылка | Ответить | Цитата
 23RaidingParty


Размещено12 de ������ de 2014 - 22:37
syssouffle wrote:
Thanks gallas for the nice edit.

Suicide i'm not the expert to explain you that, the decompression function has been written by AOHH. He mainly used the function unpack which read progressively a .scx from its first bit to its last bit. DiGiT made a documentation which tell you how is compressed the scx format.

Then it store data read in a variable, after editing the variable the script do exactly the same process than decompression but in the other direction with pack function, from your variable.

do you have link for DiGiT documentation?
i search but not find
Ссылка | Ответить | Цитата
 syssouffle


Отредактировано12 de ������ de 2014 - 23:07syssouffle
Just download aokts it is provided with it, the file is called scx_format.txt.
Ссылка | Ответить | Цитата
 23RaidingParty


Отредактировано12 de ������ de 2014 - 23:0823RaidingParty
syssouffle wrote:
Just download aokts it is provided with it, the file is called scx_format.txt.

ooh i remember now
thanks homme
Ссылка | Ответить | Цитата
 syssouffle


Размещено7 de ��� de 2015 - 21:14
Updated, easier to use. Library.php added to the script.
Ссылка | Ответить | Цитата
 Barsta


Отредактировано21 de ������� de 2015 - 16:45Barsta
I finally worked up the enthusiasm to try this out.

I'm making slow progress right now but I have to say making a hundred triggers in a few pastes really feels good!



Ah, I have hit a wall.

I can't get the activate trigger to work for me :( It just turns out red when I load the map.
Code:
Trig('act p1 t1',1,0); Efft_Act('p1 is t1');
Code:
Trig('p1 is t1',0,0); $player = 1; $x = 29; for($y = 71; $y < 81; $y++) Efft_Create($player,U_WALL_STONE,array($x,$y));
Ссылка | Ответить | Цитата
 syssouffle


Отредактировано21 de ������� de 2015 - 18:09syssouffle
I tried your code with PSE v2.4.13 / PHP v5.6.9-nts-Win32-VC11 and it's working fine for me. You can send me your whole project and tell me what PHP version you are using I'll try with it.

Also I guess you know but you have to run Compiler.php two times to make activate / deactivate effects working.

Do you see this in the output window, even after two compilations: "===>>> p1 is t1" ?
Ссылка | Ответить | Цитата
 Barsta


Размещено21 de ������� de 2015 - 18:17
syssouffle wrote:
Also I guess you know but you have to run Compiler.php two times to make activate / deactivate effects working.

Do you see this in the output window, even after two compilations: "===>>> p1 is t1" ?

I did these yes.

I'm still learning so I'll contact you when I really need to get it to work.
Ссылка | Ответить | Цитата
 Barsta


Размещено21 de ������� de 2015 - 18:29
Is there any place to copy stuff like team detection triggers?
Ссылка | Ответить | Цитата
 syssouffle


Отредактировано21 de ������� de 2015 - 19:04syssouffle
Mmmmm, it's maybe because your PHP stores files in different ways than mine for reasons that I don't know.

It doesn't find the file "Triggers.inc" where is stored triggers ids from last compilation, you can try to specify absolute path to it, it should fix this.

In compiler.php change these lines:
Code:
Line 35: if(file_exists('Triggers.inc')) include 'Triggers.inc'; # Get triggers IDs from last compilation Line 45: file_put_contents('Triggers.inc',$Conts);

To this:
Code:
Line 35: if(file_exists($TempPath.'\Triggers.inc')) include $TempPath.'\Triggers.inc'; # Get triggers IDs from last compilation Line 45: file_put_contents($TempPath.'\Triggers.inc',$Conts);

And at top of Compiler.php add this variable, and specify path to your custom temp folder, for example:
Code:
$TempPath = 'C:\Temp';

The folder must exists, else it won't work. After first compilation a file called "Triggers.inc" should be created in the folder you specified.
Quote:
Is there any place to copy stuff like team detection triggers?
No, currently all stuff is available in Library.php, more should come with updates, I add stuff that I made or people sent me. Maybe if more people get used to it I could make something like a wiki page where people can share reusable code they made.
Ссылка | Ответить | Цитата
 Barsta


Размещено21 de ������� de 2015 - 19:43
http://aoc.voobly.com/display/aoc/AoC+Knowledge+Base

Maybe you could get a section here.


Ссылка | Ответить | Цитата
[1]2
Показано 1 - 15 из of 16 посты
Быстрый пееход:
1Пользователи(-ли)читают эту тему (За последние 30 минут)
0члены,1гости

What's popular right now:
Word Association (52 users)
AoKTS updates (49 users)
Devil May Cry (23 users)
CBA HERO v18 (13 users)