Forum



KaioKen am 17.11.2017 18:57 #14734


Hey there guys,


So recently i played the original roman campaign by using the LUA's from crazyL, since i had a lot of fun and after i was

done felt like i could play some more scipted maps. I then decided to play the FANpaign, but quickly realized that i wasnt

having as much fun as i could have by played the map on RttR (for obvious reason's).

So I tried it myself, I have no knowledge of scripting at all. I used reading and common sense to copy and stich together

a script by using the already existing scripts created by CrazyL's Roman campaign.


Tell me if anything isnt working or out of the ordinary or could be done better!



I Stranded      
A mission by Achim Ruziczka


Alright, so since the alliances ingame cant change after the start setup atm, this mission does lose something by not

having to strategicly attack the red player to make him your enemy and still keep your alliance to orange. But its still

playble in this format, since you would have made red your enemy anyway. Getting past the first section of this mission is

very hard and almost pure luck atm since you cant control the orange players attack moves and he can then block your way

off and you cant attack him since hes team 1 with you(doesnt matter tho since you'd loose anyway, if you could attack

orange you would get crushed nonetheless). What makes it alot harder is you cant get to close to red since he is your enemy

from the start, it gets tricky having to man your fortress at the perfect time to attack him withour getting attacked and

red being weak enough to take 2 of his fortresses, but before orange takes them before you! The mission works just as

normal after you get the shipyard.


Map and Lua I Stranded  




II In Exile
A mission by Achim Ruziczka


Not much to say here, this should work to 100% like it did in the original.

  
Map and Lua II in Exile



III The Limes  
A mission by Achim Ruziczka


Ook, this mission would be unplayable if you woundt change the alliances, due to the fact that alliances cant change

ingame atm, which makes setting teams already impossible to the original. The original was quite interesting since your

ally yellow(who's right next to you) was on a timer untill he reached the purple player. It was set up in a way that he

would always attack purple first(whom your allied with). So you'd always have yellow as your enemy after a certain time if

you woudnt interfere. Also later on you could easely trick the green and black player into knocking themself out, because  

they were both allied to each other but only one of them to you. And doing it this way you'd always keep red your ally

Overall this mission is quite easy if you go this way.


Anyway, since that isnt possible I have layed out the teams so yellow is your ally and you two fight against the rest

( which is an option you could recreate by attacking red and is also listed as possible solutions to beat this mission on

their website).


Map and Lua III The Limes


IV Deep Freeze
A mission by Ralf Eggeling


This should work just fine, only things that play different are: If you land on purple's island he'll be your enemy from

the start not giving you time to set up and attack when you feel ready, same goes for the black player's island.


Map and Lua IV Deep Freeze


V Oceania
A mission by Heiko Bieger


To start: I do not know what !GLOBAL_SET_PATTERN and !GLOBAL_SET_PALETTE is supposed to be doing found in the RTX file, as

far as I read noone actually does. Well, Heiko Bieger surely must know. (correct me if I'm wrong)


Also I changed two things: First is the harbor location at x93 y159, I slightly changed the geographics to make it even

accessible to the player. For some odd reason the harbor can be reached in the original S2 but not in RttR, even tho the

map I used was unchanged between RttR and S2.

Second, the correct island you need to find and then destroy your harbor in order to progress is reached much, much

quicker by the AI in RttR. Making him take the mointain spot and blocking your harbor location if you are slow to get

there. I have set a restricted area there even tho there is none in S2, but thats because the maker probaly never thought

the slow AI would ever get there before you.

Map and Lua V Oceania


VI Harbor Zone
A mission by Wolfgang Zauner


The ADD_ANIMAL commands are not in place in the lua, they would have spawned some polarbears and snow-rabbits.

K then, In S2 the two enemy AI max out at ~130 generals combinded. This is just enough to beat both AI with the amount of

generals you have, but in RttR the AI doesnt retardetly waste coins which means the AI now maxes out at ~130 generals each,

while the player maxes out at ~150 generals and ~150 privates. You can see that without catapult-laming this mission is

otherwise not beatable since rushing or stealing gold is not an option and I dont intend to change the maps.

I even found a spot(click here) to freely farm yellow's generals.

Map and Lua VI Harbor Zone


VII New Sea Routes
A mission by Blue Byte revised by Achim Ruziczka

Really nothing to say here, since its basicly just the original map slightly altered.

Map and Lua VII New Sea Routes


VIII Desert
A mission by Achim Ruziczka

I tested the map and it should work just fine, except that you have to play the map twice to beat it if you dont know how

to beat it from the start. Pretty bad mad design imo, I have a replay attached to the files maybe I'll create a replay for

the other missions aswell if anyone wants to know/see how to beat some of them. Also for some reason on this map water

fountains sprang out of the ground all over the map in yellow and blue color depending on which players land it was.

No idea why, maybe some ground tiles trigger this effect?

Map and Lua VIII Desert


IX Intermezzo
A mission by Achim Ruziczka

The AI wont start to attack your HQ after a certain time since the attackrange isnt as far as in S2 but that alright  

because the stronger AI makes up for it.

Map and Lua XI Intermezzo

Editiert von KaioKen am 19.01.2018 23:49

KaioKen am 24.11.2017 22:39 #14737


Maybe some1 could help me out, in the first mission for some reason i can only have 1 onExplored function working at a time, even tho there is no script error showing in the RttR:log they both work but only if i disable one of them any ideas?


Spike am 25.11.2017 09:47 #14738

Im Ruhestand
Yes, you can only have one function for the event at a time. You need to use if/elseif/else statements.

---



KaioKen am 25.11.2017 11:31 #14739


Hm thats so wierd, i checked the file i uploaded and i did indeed have the elseif statement and they worked just fine as i

tested them. For some reasong after i uploaded them yesterday i played the mission again and i coundt get it to work, even

tho i have the exact same onExplored function with the elseif statement. Well what fs it works, dont fix it if it aint

broken.


Also i had a couple of times when i copied the messageses from the rtx text files and there where certain single letters

which caused to text not to appear on screen with no lua error. For instant the J from "Juergen Nagel", i had to retype the

letter only then it worked(after deleting every word one by one and checking if it would work without it, till i got to the

J) I guess it just must have been a different type of text format?


Spike am 25.11.2017 11:48 #14740

Im Ruhestand
Hmm, I don't really get your current
problem.

Thought you have(pseudo code) :
onExplored(x, y)
   rttr:MissionStatement("its the first")
End function

onExplored(x, y)
   rttr:MissionStatement("its the second")
End function

And then only one worked at a time.

Regarding the letter problem: Save the
file utf-8 coded, windows uses ansi by
default. That should solve the problem as
well.

Maybe later this day, around 7pm, we could
talk and solve all myteries ;)

---



KaioKen am 25.11.2017 14:45 #14741


Welp, dont think i have any problems aynmore atm i tried a couple times more with the onExplored and all went fine,also I now utf-8 encoded it!!!( i had no idea about that :^), now i dont have to retype the complete Missiontext anymore when that comes up^^. But why are some letters differently "encoded"? / why cant the programn read them?


Flamefire am 25.11.2017 16:48 #14742


We switched to UTF8 at some point to support international characters. All strings in RTTR are UTF8. We convert the old OEM encoding from the maps to UTF8 when we read it but all other input (translations, lua) is expected to be UTF8.

If you try to print invalid UTF8 (e.g. other encoding) an exception will be thrown. Not sure why "nothing" happens for you. Maybe the script just failed to load and nothing is working at all? Also "J" should not be a problem. Did you maybe had "Jürgen" instead of "Juergen"? The umlaut is a special char which needs proper utf8-encoding.

Why the program can't read them is simple: If something is not valid UTF8 it might be anything. We cannot even guess what letter was meant without additional information (e.g. the language the script was written in) so we simply don't guess and bail out.

Note: There is an upcoming change that the settings part of the lua script is only loaded on the host side. This affects "onSettingsInit" and all other settings events ("onPlayerReady", "onPlayerJoined", ...) which won't be called for clients. This doesn't matter for single player games (as there is only the host) but for multiplayer games this matters.
Also don't expect that after player:SetNation() you can instantly get the nation. This will be a request to the server and only changed as soon as the server replied which is fast but not instant.
In the current version this is instant but it won't be anymore.

---
Github: https://github.com/Flamefire


KaioKen am 25.11.2017 17:59 #14743


Yea was probaly the ü, I just retyped the word. Ah I see tho, the special letters where written within a different encoding and thus cant be translated. thx :^)


Spike am 25.11.2017 18:57 #14744

Im Ruhestand
And yes, using "invalid" chars in texts
just causes to not show any text which is
quite frustrating and took me some time to
figure out (first I thought it was length
dependant). I agree that sowing something
at least in the log would be better than
silent failing.

---



Flamefire am 26.11.2017 14:49 #14747


Could you provide me with something that should be shown but doesn't so I can test this? I'll add a log output for you :)

---
Github: https://github.com/Flamefire


KaioKen am 26.11.2017 15:53 #14748


Well, i just tried to recreate it. I do infact get an error in the RttR log, which sadly only points to the MissionStatement, MissionEvent and MissionText, but not the the line which contains the utf-8 error. Also the script loads just fine otherwise. I get no message in the lobby tho that something doesnt work.

Also is there somewhere a list of all the functions RttR has?


Flamefire am 26.11.2017 18:53 #14750


I need something to recreate this, so just upload something that errors and tell me what and where should happen so I can take a look.

Yes there is: In the github wiki: https://github.com/Return-To-The-Roots/s25client/wiki/Lua-Scripting

---
Github: https://github.com/Flamefire


KaioKen am 27.11.2017 19:44 #14752


Ok, so the 1st is that as i said before that the error log message doesnt show at what line the utf-8 is. It only shows Missentevent, text and so on but still lets the script laod instead of blocking the script from even starting( which should maybe be done? idk) its the Missionevent 2 at 30 GF which doesnt show cause utf-8

To the no error in the log. If you check i have 2 statements in the OnExplored function and I am even using the elseif statement inbetween( since spike said elseif should work- which it odly doesnt as you will see). So only 1 MissionEvent then shows and the other one doesnt with no error in the log. build a watchtower next to your HQ to proc.

Map and Lua to test


Flamefire am 30.11.2017 18:06 #14763


I added a function to check and report UTF8 issues. You will find it quite helpful.

As for your bug: You have a typo in your first check: Uppercase Y instead of y. So this can never be true as Y is unset.

---
Github: https://github.com/Flamefire


KaioKen am 04.12.2017 14:41 #14767


Oooh, well that explains things. I think i probaly just kept CTRL+C-ing the whole time or using the -- to dis/enable it and thats why it remainded ^^


KaioKen am 16.12.2017 20:35 #14788


Also if anyone might know, flamefire probaly: When I e.g. load the lua from MISSB204 it still says in the RttR log that lua

MISSB201 has been loaded instead of MISSB204. I know I just copied the lua's and changed their context but even if i rename

the lua the MISSB201 remains in the log. Any idea why?


Flamefire am 16.12.2017 22:08 #14791


What? That sounds confusing. Could you post the relevant part of the log?

---
Github: https://github.com/Flamefire


KaioKen am 17.12.2017 11:41 #14793


-----------------------
MISSB201.lua loaded...
-----------------------

It's just the header of the log which tells you what lua has been loaded when you enter the game ready lobby. I am just wondering why the name doesnt change there even tho the file name I'm using is not called MISSB201.lua. It's really just the name in the log, the correct lua file I want to laod is still being loaded. If you downlaod the lua of the last map I uplaoded and open it you'll see i guess.


Spike am 17.12.2017 13:12 #14795

Im Ruhestand
Maybe in the saved games directory a .lua file exists, named missb204.lua containing your line debug log?

---



Flamefire am 17.12.2017 13:18 #14796


Yep. It's definitely the lua file because the game itself does not issue such a line. So in your lua file must be a log command that writes this.

---
Github: https://github.com/Flamefire


KaioKen am 17.12.2017 16:03 #14797


Yes, you're absolutely right. That was an unnecessary waste of time, I must have been blind.


Spike am 26.12.2017 18:23 #14812

Im Ruhestand
Tried mission I and ran into several problems.

a) The script on page 1 is still using non utf-8 coding
b) The script seems the to stop the game right after the first GF, I had to hit pause twice
c) Is it correct that you have to beat red without a mint in order to get the shipyard to unlock the mint?

---



KaioKen am 30.12.2017 17:45 #14822


First, must have missed your post only know am i seeing it.

1) Yes it is, but since every text is being displaded correctly and working fine I didnt see a reason( I also just didnt think about it tbh) to change it. So why does it matter now if its not UTF-8 encoded if all messages are being shown without problems?

2) What do you mean its stops twice? Because its supposed to show 2 different message at the beginning first to introduce you to the Fanpaign and 2nd to the first mission.

3)Yes, not only red also purple. Read the text i wrote to the mission on my first post here. If I didnt explain it right, you have to use orange to beat red for you, by getting above orange fast enought before he blocks the area for you. Then remove the rocks between you and orange( he cant because he doesnt have any stonemasons). After that get close to red from under the mountain and let him attack you and capture your building so orange can then attack him and crush his army suply.
Sneek up to red from above the mountain and try attacking him when he is weak. I explain in my first post why this is so hard, on top of that the attack range of fortresses in RttR is much smaller than S2( in S2 you where able to attack insanly far away, which hurts me in mission 8 atm very hard <.<) which makes it even harder attacking red since you cant even attack with all your soldiers of 1 fortress.

Thanks for the feedback, ask me anything else about it :-)

Editiert von KaioKen am 30.12.2017 20:28

Holzi85 am 06.01.2018 17:18 #14835


Hello!
I'm not really sure but do you think this commit:
https://github.com/Return-To-The-Roots/s25client/commit/2065378d2a568ba05000e768fc4e3f379941c672 will
help with the alliances during the game?
Thanks for your work! :)

Editiert von Holzi85 am 06.01.2018 17:21

KaioKen am 07.01.2018 00:14 #14836


Yes! It definitly will, wow thanks for mentioning because I dont look at Github so I probaly woundt have seen this for a while. I'll still have to wrap my head around this since I'm not too fond of this ^^. Thanks for the kind words, but honestly I dont want to take much credit for this, I personaly feel I'm just changing values of an already existing script.


Edit: I guess a big problem for the missions would be that you cant see in any way the pact's of the AI players to each other. In most missions breaking one pact(attacking someone) will cause a chain-reaction between the AI's changing allegiances between them without you then knowing or noticing this. Which is a huge gameplay factor which determents how one would continue to play the mission. Hm might be pretty bad since you would have no idea whats going on if you woundt know the map.

Editiert von KaioKen am 07.01.2018 00:35

Flamefire am 07.01.2018 11:27 #14837


What about the script sends a message to the players when a pact is made? Or maybe we should do this globally: Every time a pact is made or dismissed a system message is sent to all players "X and Y concluded a non-aggression pact( for n GFs)"

---
Github: https://github.com/Flamefire


Holzi85 am 08.01.2018 16:39 #14838


Sounds pretty good if this would be possible.


Unterwald am 21.06.2020 19:24 #15513


Hi there,

Just added GER and ENG Mission Texts for the first FANpaign map as well as the "Hints"
Link:
https://1drv.ms/u/s!Auj3J_-Jk0MMnWhOZAktn_w_PLDF?e=KtoyYw

But why is the script for the buildings (Shipyard...) "on occupied" - in the original it was "on explored"?

Editiert von Unterwald am 21.06.2020 20:45



Feel free to post in English!

Antwort schreiben

Username:
Security code:
Text:

   
  Convert smilies like :), ;) etc. into small graphics?
  Convert WWW-addresses into clickable links?
  Soll Boardcode in ihrer Nachricht aktiviert werden?