Author Topic: Scripts on 1.6.4 version  (Read 5179 times)

0 Members and 1 Guest are viewing this topic.

Offline Bydlak

  • Major(1)
  • Posts: 34
Scripts on 1.6.4 version
« 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.

DarkCrusade

  • Guest
Re: Scripts on 1.6.4 version
« Reply #1 on: July 23, 2013, 02:58:26 pm »
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?

Offline Vos

  • Soldier
  • **
  • Posts: 231
    • http://kosoldat.forumer.com/index.php
Re: Scripts on 1.6.4 version
« Reply #2 on: July 23, 2013, 03:11:58 pm »
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.
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.

DarkCrusade

  • Guest
Re: Scripts on 1.6.4 version
« Reply #3 on: July 23, 2013, 03:52:49 pm »
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? ;)

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Scripts on 1.6.4 version
« Reply #4 on: July 23, 2013, 03:58:37 pm »
"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')+'); ';
« Last Edit: July 23, 2013, 04:04:15 pm by Silnikos »

DarkCrusade

  • Guest
Re: Scripts on 1.6.4 version
« Reply #5 on: July 23, 2013, 04:48:17 pm »
This should be working:

Code: (pascal) [Select]
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' ;)

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripts on 1.6.4 version
« Reply #6 on: July 23, 2013, 04:48:39 pm »
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

Sorry for the inconvenience.
« Last Edit: July 23, 2013, 05:09:12 pm by FalconPL »
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline No-Mercy

  • Major
  • *
  • Posts: 55
Re: Scripts on 1.6.4 version
« Reply #7 on: July 23, 2013, 07:30:08 pm »
70 % of old scripts don't work now!

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Scripts on 1.6.4 version
« Reply #8 on: July 24, 2013, 12:38:59 am »
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.

DarkCrusade

  • Guest
Re: Scripts on 1.6.4 version
« Reply #9 on: July 24, 2013, 08:01:56 am »
These 'errors' are but mere reminders of variables or comparisons that are not needed. Float conversion is bugged, though, but will be fixed soon.

Offline Mittsu

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 617
Re: Scripts on 1.6.4 version
« Reply #10 on: July 24, 2013, 09:12:12 am »
check at ARSSE what errors those scripts give when compiling, it will tell you what to do (at least it did for me)
Realistic-Soldat.net
<+elerok> soldat is dead
<+AThousandD> shit happens

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripts on 1.6.4 version
« Reply #11 on: July 24, 2013, 10:47:09 am »
perhaps paste that wrong line here so we can help you sort it out.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Scripts on 1.6.4 version
« Reply #12 on: July 24, 2013, 01:01:27 pm »
@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.

Offline Hubiq

  • Soldier
  • **
  • Posts: 119
Re: Scripts on 1.6.4 version
« Reply #13 on: July 24, 2013, 03:46:28 pm »
On the new version does not work all the scripts? Or just some?

Offline Bydlak

  • Major(1)
  • Posts: 34
Re: Scripts on 1.6.4 version
« Reply #14 on: July 24, 2013, 04:01:14 pm »
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?  ;)
« Last Edit: July 24, 2013, 06:08:33 pm by Bydlak »

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Scripts on 1.6.4 version
« Reply #15 on: July 24, 2013, 04:23:35 pm »
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
« Last Edit: July 24, 2013, 04:27:19 pm by skrX »

Offline No-Mercy

  • Major
  • *
  • Posts: 55
Re: Scripts on 1.6.4 version
« Reply #16 on: July 24, 2013, 04:27:03 pm »
I have problems whit: Kdratio, Publictools! Stats whit rank works fine for me!

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Scripts on 1.6.4 version
« Reply #17 on: July 24, 2013, 04:30:53 pm »
@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.

Offline No-Mercy

  • Major
  • *
  • Posts: 55
Re: Scripts on 1.6.4 version
« Reply #18 on: July 24, 2013, 05:43:06 pm »
@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?

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Scripts on 1.6.4 version
« Reply #19 on: July 25, 2013, 06:45:10 am »
I wish we could choose between old and 'new' scriptcore

Im chill like that