Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started by: Bydlak on July 23, 2013, 02:24:30 pm
-
Hi
Do scripts which worked well on 1.6.3 version have to be updated or reconstructed to use them on 1.6.4?
After moving serv from old version to 1.6.4 some of scripts didn't work or worked in other way than before. Dunno is that the scripts issue or the serv problem.
-
The old scriptcore (SC2, that is) is still working. Scripts that use the new scriptcore differ in structure, so your scripts should be running perfectly fine. Could you post some log files that give us some insight on what's actually bothering the server?
-
I also have and had allot of trouble with the scripts on my servers.
To be honest I find it kind of strange that there is nothing mentioned in the changelog regarding scriptcore changes and whatever else changed regarding the scripts.
But, it's being worked on for now.
-
From my understanding, Falcon spend a lot of time to finish SC3 for it to be ready for the release and with all the new fancy stuff, we need a thorough documentation, which is being worked on. Just give it some time! After all, how long have we waited for this release? ;)
-
"Exception: Invalid variant type cast" all day, all night.
Everything worked fine before the patch, now I get above error for lines defining variables, like this:
alpha_players := alpha_players+idtoname(i)+' ('+GetPlayerStat(i,'Kills')+'/'+GetPlayerStat(i,'Deaths')+', F:'+GetPlayerStat(i,'Flags')+'); ';
-
This should be working:
var alpha_players:string;
alpha_players := alpha_players+idtoname(i)+' ('+inttostr(getplayerstat(i,'kills'))+'/'+inttostr(getplayerstat(i,'deaths'))+', F:'+inttostr(getplayerstat(i,'flags')+'); ';
I do not even know why that should have been working in the older script core. Something like what you typed above works in newer programming languages, but you have to turn your integer values to string values to save them in 'alpha_players' ;)
-
tl;dr: If your script was written without obvious bugs like missing semicolons, it should work on new server without problems.
I did everything i could to preserve backward compatibility but unfortunately it's not complete. This is a result of various things, mostly because of updating Pascal Script (scriptcore's engine) to newest version and switching from Delphi 7 to Free Pascal Compiler. Those are things that i couldn't influence by much and i couldn't also fix without putting some serious amount of work into it.
Errors you'll see appearing mostly:
- Missing semicolon: to solve it just add that missing semicolon, either in line it's pointing out or line above (see which one misses it)
- Invalid variant type cast: Variants variables/function results are used without conversion in your code. Wrap them with IntToStr()/FloatToStr()/StrToInt() and similar to get rid of them
- Wrong division result: Some divisions that you expect to produce floating point value might give you rounded result (integer). To get rid of this, cast dividend, divisor or both to single or double (wrap them with Single() or Double())
If you encounter any other problems which you cannot solve yourself then please either reply here, or ask on #soldat.devs. Or if the errors seems to be API related, report it on bugtracker (http://bugs.soldat.pl)
Sorry for the inconvenience.
-
70 % of old scripts don't work now!
-
This should be working:
I do not even know why that should have been working in the older script core. Something like what you typed above works in newer programming languages, but you have to turn your integer values to string values to save them in 'alpha_players' ;)
Yeah that's my mistake, I didn't even checked that because it used to work in the old server version somehow.
-
These 'errors' are but mere reminders of variables or comparisons that are not needed. Float conversion is bugged, though, but will be fixed soon.
-
check at ARSSE what errors those scripts give when compiling, it will tell you what to do (at least it did for me)
-
perhaps paste that wrong line here so we can help you sort it out.
-
@Akinaro: This script, stats with rank was not tested the current version core (2.7.4) for this reason, there are complications.
It is intended only for version 2.7.3. I'll probably have to update the script.
-
On the new version does not work all the scripts? Or just some?
-
Well I have a problem with that scripts:
1. Nextmap Voting: http://forums.soldat.pl/index.php?topic=13382.msg150372#msg150372
Server Visits : http://forums.soldat.pl/index.php?topic=35003.msg453082#msg453082
Stats and rang : http://forums.soldat.pl/index.php?topic=35944.msg437083#msg437083
The problem is that plenty of figures "0" are added after comma. example: 25.00000000000000% voted on next map or daily server visits: 162,00000000000000.
It doesn't looks good :)
Stats and rang are complitely broken couse there are only zeros everywhere
2. The script which is called "Spawn Shield" doesn't work as well
Anybody knows how to rewrite these scripts to the new soldat version? ;)
-
Don't panic :P
Comming soon, some scripts will be updated. But, not all. Most scripts have a few years, a lot of change not enough ... so, this is problem.
The problem is usually rate, split ... or something :S
-
I have problems whit: Kdratio, Publictools! Stats whit rank works fine for me!
-
@No-Mercy: Yes, I must update publictools and stats with rank. The issue lies in rate. I think that, make it to the end of the week.
-
@No-Mercy: Yes, I must update publictools and stats with rank. The issue lies in rate. I think that, make it to the end of the week.
For publictools I solved whit Basics and edit something.
In Stats whit rank, yes the problem it is whit Kd ratio, thanks in advance.
Will be able to create even a k/d top permanently?
-
I wish we could choose between old and 'new' scriptcore
-
Also this: http://forums.soldat.pl/index.php?topic=42758.0
-
I wish we could choose between old and 'new' scriptcore
I wish people were writing their scripts with common sense. Then they'd notice that there actually is a choice between "new" and "old" scriptcore.
Most of those errors are because scripts were poorly written. What new compiler does is simply being more restrictive. I'm not saying that this is allright because it's clearly not, i'm just saying that it's not only me to blame. If you're looking for the 2nd guilty person, look into the mirror.
Also absolutely nobody dared to test scriptcore in any of 4 released RC versions. Maybe if you did, we could together do something to prevent it earlier. But you didn't. Now live with it.
-
NVM
edit: was everyone able to test the new scriptcore? or just the beta team
-
Were RC releases public? I think they were. At least three of them.
-
Didn't know they were working with the new scriptcore already tbh, didnt read that anywhere either.. but might have missed that
-
It's not about new scriptcore, as i mentioned above it's about changing compiler to FPC and PascalScript to newest. New scriptcore is seperated.
-
Which scripts do not work? Only the more complicated? e.g. killing sprees, track, awards, ratio, stats etc.?
-
Most scripts that have 'ratio' or split something.
-
basically every script that has percentages and numbers rolling
-
I don't know if anyone else noticed but apparently some object styles in SpawnObjet() and GetObjectStat() have changed.
E.g. knife used to have ObjTyp=12 in SpawnObject() and now it's 13, 12 is chainsaw now.
-
It wasn't desired. Report it on mantis maybe so i don't forget about it.
-
2.7.3
-
It wasn't desired. Report it on mantis maybe so i don't forget about it.
Here you go http://bugs.soldat.pl/view.php?id=346
-
there's this little problem with displaying statistics with too many zeros
(http://img209.imageshack.us/img209/7540/ydor.jpg)
-
there's this little problem with displaying statistics with too many zeros
(http://img209.imageshack.us/img209/7540/ydor.jpg)
Use FormatFloat('format',float_value) instead of FloatToStr() to get rid of them.
http://www.delphibasics.co.uk/RTL.asp?Name=FormatFloat
-
thanks
-
Well I have no idea how to use the FormatFloat to get rit of the zeros in both scripts and I can't find anybody who has fixed them.
Have anybody fixed this or could show me a way how to do it? I would be grateful
-
Replace every "FloatToStr(" with "FormatFloat('', "
-
For those who still have problems with this:
Example:
FloattoStr(RoundTo(100 * Total / NumPlayers, 2))
FormatFloat('value',code)
FormatFloat('00',RoundTo(100 * Total / NumPlayers, 2))
-
For those who still have problems with this:
Example:
FloattoStr(RoundTo(100 * Total / NumPlayers, 2))
FormatFloat('value',code)
FormatFloat('00',RoundTo(100 * Total / NumPlayers, 2))
FormatFloat('##0.##',100.00 * Total / NumPlayers);
Works fine without RoundTo. Unless that 0.009% makes a difference
-
Somewhere on bugtracket, I read that the problem only occurs on servers running Windows. But I do like the falcon wrote in his guide, and you should be fine.