Author Topic: Scripts on 1.6.4 version  (Read 5167 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

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Scripts on 1.6.4 version
« Reply #20 on: July 25, 2013, 07:15:58 am »

Im chill like that

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripts on 1.6.4 version
« Reply #21 on: July 25, 2013, 07:26:09 am »
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.
« Last Edit: July 25, 2013, 07:50:00 am 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 Vos

  • Soldier
  • **
  • Posts: 231
    • http://kosoldat.forumer.com/index.php
Re: Scripts on 1.6.4 version
« Reply #22 on: July 25, 2013, 09:43:05 am »
NVM

edit: was everyone able to test the new scriptcore? or just the beta team
« Last Edit: July 25, 2013, 09:46:15 am by Vos »
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.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripts on 1.6.4 version
« Reply #23 on: July 25, 2013, 09:58:28 am »
Were RC releases public? I think they were. At least three of them.
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 Vos

  • Soldier
  • **
  • Posts: 231
    • http://kosoldat.forumer.com/index.php
Re: Scripts on 1.6.4 version
« Reply #24 on: July 25, 2013, 10:13:54 am »
Didn't know they were working with the new scriptcore already tbh, didnt read that anywhere either.. but might have missed that
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.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripts on 1.6.4 version
« Reply #25 on: July 25, 2013, 10:40:31 am »
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.
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 Hubiq

  • Soldier
  • **
  • Posts: 119
Re: Scripts on 1.6.4 version
« Reply #26 on: July 25, 2013, 02:24:53 pm »
Which scripts do not work? Only the more complicated? e.g. killing sprees, track, awards, ratio, stats etc.?

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Scripts on 1.6.4 version
« Reply #27 on: July 26, 2013, 05:25:06 am »
Most scripts that have 'ratio' or split something.

Offline Vos

  • Soldier
  • **
  • Posts: 231
    • http://kosoldat.forumer.com/index.php
Re: Scripts on 1.6.4 version
« Reply #28 on: July 26, 2013, 05:44:38 am »
basically every script that has percentages and numbers rolling
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.

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Scripts on 1.6.4 version
« Reply #29 on: July 26, 2013, 10:05:53 am »
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.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripts on 1.6.4 version
« Reply #30 on: July 26, 2013, 11:16:12 am »
It wasn't desired. Report it on mantis maybe so i don't forget about it.
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 #31 on: July 26, 2013, 01:33:06 pm »
2.7.3

« Last Edit: July 27, 2013, 05:15:43 am by skrX »

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Scripts on 1.6.4 version
« Reply #32 on: July 26, 2013, 07:33:29 pm »
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

Offline Mittsu

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 617
Re: Scripts on 1.6.4 version
« Reply #33 on: July 27, 2013, 02:53:16 am »
there's this little problem with displaying statistics with too many zeros

Realistic-Soldat.net
<+elerok> soldat is dead
<+AThousandD> shit happens

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Scripts on 1.6.4 version
« Reply #34 on: July 27, 2013, 03:11:15 am »
there's this little problem with displaying statistics with too many zeros


Use FormatFloat('format',float_value) instead of FloatToStr() to get rid of them.
http://www.delphibasics.co.uk/RTL.asp?Name=FormatFloat

Offline Mittsu

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 617
Re: Scripts on 1.6.4 version
« Reply #35 on: July 27, 2013, 03:35:06 am »
thanks
Realistic-Soldat.net
<+elerok> soldat is dead
<+AThousandD> shit happens

Offline Bydlak

  • Major(1)
  • Posts: 34
Re: Scripts on 1.6.4 version
« Reply #36 on: August 08, 2013, 04:51:55 pm »
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

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripts on 1.6.4 version
« Reply #37 on: August 08, 2013, 05:16:21 pm »
Replace every "FloatToStr(" with "FormatFloat('', "
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 #38 on: August 09, 2013, 07:30:07 am »
For those who still have problems with this:

Example:
Code: [Select]
FloattoStr(RoundTo(100 * Total / NumPlayers, 2))

FormatFloat('value',code)
FormatFloat('00',RoundTo(100 * Total / NumPlayers, 2))

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Scripts on 1.6.4 version
« Reply #39 on: August 09, 2013, 08:05:02 am »
For those who still have problems with this:

Example:
Code: [Select]
FloattoStr(RoundTo(100 * Total / NumPlayers, 2))

FormatFloat('value',code)
FormatFloat('00',RoundTo(100 * Total / NumPlayers, 2))

Code: [Select]
FormatFloat('##0.##',100.00 * Total / NumPlayers);Works fine without RoundTo. Unless that 0.009% makes a difference
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Re: Scripts on 1.6.4 version
« Reply #40 on: August 10, 2013, 01:01:40 am »
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.