Hello.
Long time i came here.. ^^
I have a question, or i mean.. I think i have a request..
I've made some cool smart, small and big maps and i wish implement "Ants" on my maps with some "Hives", like the Extras missions from C&C RA..
After some bad results with my tests, i got an idea to find help here with a good person who want try to help me in this "project"..
I precise i have Visual Studio 2019 with Python / JSON and some other extensions if needed.
The "lua" format is complicated for me and im trying to learn how to use it
PS : I hope you understand what i'm trying to say (i got a bad english.. )
Thanks for your time to read me.
Cordialy.
[*] 2 exemples of my maps here :
1st map :
2nd map :
Add Ants attacks on a map
- Materianer
- Posts: 199
- Joined: Mon Jul 04, 2016 8:27 am
Re: Add Ants attacks on a map
I started because of the same thing with mapcoding
Here is an example how you can make such an ant walk around and attack.
https://resource.openra.net/maps/56896
In this map i added a whole Antrace with the Anthill as a destroyable building, antqueen etc. but the code might be a bit outdated.
https://resource.openra.net/maps/41552/
Here is an example how you can make such an ant walk around and attack.
https://resource.openra.net/maps/56896
In this map i added a whole Antrace with the Anthill as a destroyable building, antqueen etc. but the code might be a bit outdated.
https://resource.openra.net/maps/41552/
-
- Posts: 13
- Joined: Sat Dec 01, 2018 5:35 pm
Re: Add Ants attacks on a map
Oohhh ! Nice one with the red Queens and blood
Sure its updates, cause lot of items are removed or replaced.. Lol.
But yes, on the form is the type of map i want to do. But i dont really know of making Lua code properly here..
If you or someone want to work with me on it on one of my maps, i will be happy
The first map will be better :
https://resource.openra.net/maps/56790/
Cause the other one is too huge, and i think is better for scenario... xD :
https://resource.openra.net/maps/56791/
Sure its updates, cause lot of items are removed or replaced.. Lol.
But yes, on the form is the type of map i want to do. But i dont really know of making Lua code properly here..
If you or someone want to work with me on it on one of my maps, i will be happy
The first map will be better :
https://resource.openra.net/maps/56790/
Cause the other one is too huge, and i think is better for scenario... xD :
https://resource.openra.net/maps/56791/
- Materianer
- Posts: 199
- Joined: Mon Jul 04, 2016 8:27 am
Re: Add Ants attacks on a map
I think a good way to learn this lua stuff is to read and test other maps with lua code.
You could for example try to just copy the lua file from the first map i posted.
https://resource.openra.net/maps/56896
It should will work if you add 4 Waypoints to your map then and change the names of the waypoints to:
upperleft, upperright, downleft, downright
You will find those words in the lua file, the Waypoints are used there for the way the ants walk and where the ant spawns.
You could for example try to just copy the lua file from the first map i posted.
https://resource.openra.net/maps/56896
It should will work if you add 4 Waypoints to your map then and change the names of the waypoints to:
upperleft, upperright, downleft, downright
You will find those words in the lua file, the Waypoints are used there for the way the ants walk and where the ant spawns.
-
- Posts: 13
- Joined: Sat Dec 01, 2018 5:35 pm
Re: Add Ants attacks on a map
Oh, thanks. Okay ^^
But you sure it will work ? Cause you map got "Link chess status" : failed .
I have to unpack to openra file first to see that.
Thanks for your soluce . But i continue to check for the "word keys" descriptions to code the "Lua" file
But you sure it will work ? Cause you map got "Link chess status" : failed .
I have to unpack to openra file first to see that.
Thanks for your soluce . But i continue to check for the "word keys" descriptions to code the "Lua" file
- Materianer
- Posts: 199
- Joined: Mon Jul 04, 2016 8:27 am
Re: Add Ants attacks on a map
Yes i´m pretty sure i dont think that Luaerrors are listed there and you can use like 99% of old Luacode because luachanges are really rare.
If you have a Luacrash it doesnt crash like normal, instead you will have a Message ingame and find an Errormessage in the Lua.log
The error on my map is because of the Interior rules wich i added to the map.
No Airunits or ships needed in Rooms so i removed the Naval AI too, wich is maybe renamed in the yamlcode meanwhile, you can see the errormessage if you click on the red Lintcheck letters in resource center. ctrl F error
But you only need 2 Lines for your rules.yaml to add the ants:
and of course add the luafile to your mapfolder.
by the way the ants will not come at start but at a randomtime between 0 and 180 Seconds, you can see this in the WorldLoaded function on the bottom of the file, the things in this function happen at start.
You can just change the 180 to 5 and then it will come between 0 and 5 Seconds.
Try
for more ants
If you have a Luacrash it doesnt crash like normal, instead you will have a Message ingame and find an Errormessage in the Lua.log
The error on my map is because of the Interior rules wich i added to the map.
No Airunits or ships needed in Rooms so i removed the Naval AI too, wich is maybe renamed in the yamlcode meanwhile, you can see the errormessage if you click on the red Lintcheck letters in resource center. ctrl F error
But you only need 2 Lines for your rules.yaml to add the ants:
Code: Select all
World:
LuaScript:
Scripts: Brunsbuettel.lua
by the way the ants will not come at start but at a randomtime between 0 and 180 Seconds, you can see this in the WorldLoaded function on the bottom of the file, the things in this function happen at start.
Code: Select all
Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(0, 180)), function()
Try
Code: Select all
ActivateAnt1()
ActivateAnt1()
ActivateAnt1()