Author Topic: Devlog update (2013-06-02) New script core  (Read 8862 times)

0 Members and 1 Guest are viewing this topic.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Devlog update (2013-06-02) New script core
« on: June 02, 2013, 05:36:29 pm »
Hi,

First info for those of you who aren't really into scripting: Release is, as you can see, delayed again. Not sure what stopped Shoozza this time, i swear it's not me. New deadline is set for Friday.

For the scripters, i have other, hopefuly good news.

You might've noticed that i was mentioning something about "working on scriptcore" in my previous devlogs. What i was really doing, was rewriting it pretty much from scratch. The only part that didn't change is it's engine, pascal script.
What did i change then?

  • Preprocessor. Good old preprocessor, known from enesce's version is back. you can use {$Defines}, {$Ifdefs} and {$include}. However instead of {$Include} i'd suggest to use...
  • Units. If you know pascal already, you probably know what am i talking about. If not, i'll quickly describe that units are some kind of "modules", some example tutorial here.
  • Config file. Say goodbye to -safe switch, in new scriptcore each feature that script can access is defined by it's own config file which is visible and readable for server owner and can be also constrained by global server config file. It's now you who decide what your script can do or not (for instance whenever it can access entire harddrive, use dlls and so on)
  • Precached bytecode. New script core caches the bytecode produced from your source file. It makes compilation process faster, especially if you have many scripts or your scripts are noticably big
  • Object-oriented API. That one took me longest to implement and is still incomplete. Basically, things like GetPlayerStat() were pissing me off, so i decided to change them. So now instead of GetPlayerStat(1, 'Alive') you'll do Players[1].Alive. Or Players[1].Kick(). Instead of ugly ReadIni() you'll create your own INI file handle and do things like MyIniFile.ReadInteger() or MyIniFile.WriteInteger(). It has a downside though, because some memory management is on you. So once you created ini handle, you also have to free it with MyIniFile.Free() or you'll get memory leak. I'll try to resolve that issue in the future.
    As i mentioned, it's incomplete. Entire adminport management is missing (OnAdminMessage/Connected/Disconnected) + there's no CreateBullet as that belongs to bullet management which i didn't code yet either. But, they'll all finally arrive
  • Event properites. By default, when you launch your script, only main block ("activate server") will be called, and nothing else. Wut? All events are now handled by event properties. You want AppOnIdle (now called OnClockTick btw)? You have to register for it, by doing Game.OnClockTick := @MyOnClockTickHandlerFunction. Then it'll be called untill you unregister, or script is shutdown. There are some special event properties, for instance there's one for exception handler which is called when unhandled exception happens in your code. Then it's up to you to decide whenever exception was critical enough to shutdown your script or not by returning True or False.
    Event properties were possible to make only because of Mr. Thanks man! And yes, that means i've successfully dragged him away from anticheat code :P
  • But, what about backward compatibility? First of all, old scriptcore stays. All the scripts that were written will be launched using deprecated now ScriptCore2. ScriptCore3 (cause that's the codename) can be launched in so called "Legacy mode", in which all ScriptCore2's API will be also available. So in theory, every ScriptCore2 valid script should launch in ScriptCore3 with legacy mode on. That might be not always the case though, because you might have variable name collisions (You might for instance declare Players variable, which is now reserved by scriptcore itself).
That's all about changes, if you ask about what changed in actual functionality (in API) - not much, i've tried to make it as funcional as the old one for now. I'll be constantly improving it over time. Howver since this is a rather fresh thing, there's one thing you have to remember:
In new script core i guarantee NO BACKWARD COMPATIBILITY. The API is too young to maintain it backward compatible, especially if it turns out to be buggy (i didn't test it too well due to lack of time). So if you decide to jump in and code using new API, be aware that your script might not be functional in the future if you won't maintain them. That doesn't count for ScriptCore2 scripts, as i'm now leaving ScriptCore2 in peace, there'll be no more changes there.

Documentation for all that stuff does not exist yet either, as again, i had no time to write it. I'll start doing so once i'm done with coding, and that is when finall release happen.

In case of any questions, either ask them here, or you know where to find me.
In case of bugs, our bug tracker is waiting for you.
« Last Edit: June 02, 2013, 05:56:00 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 Shoozza

  • Moderator
  • Veteran
  • *****
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: Devlog update (2013-06-02) New script core
« Reply #1 on: June 02, 2013, 05:44:40 pm »
Yeah it's my fault somehow the humble indie bundle ate my time (and i only played one game so far).

Well I have just compiled the rc2. The updater setup is not ready yet (duplicate chinese translation files after install, additional ini changes need to be checked).
I'll let the beta team test the rc2 in the next few days so we don't rush a broken rc again ;)
Rules
Tools: ARSSE - SARS - SRB - chatMod

DarkCrusade

  • Guest
Re: Devlog update (2013-06-02) New script core
« Reply #2 on: June 02, 2013, 05:59:49 pm »
This. Is. Awesome.

We get units? I'd wait another month if I'd have to.

Quality over quantity!

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Devlog update (2013-06-02) New script core
« Reply #3 on: June 02, 2013, 06:55:04 pm »
Truly awesome!
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline L[0ne]R

  • Soldat Beta Team
  • Rainbow Warrior
  • ******
  • Posts: 2079
  • need a life. looking for donors.
Re: Devlog update (2013-06-02) New script core
« Reply #4 on: June 02, 2013, 07:16:27 pm »
Yeah it's my fault somehow the humble indie bundle ate my time (and i only played one game so far).
Well guess what, there's a new weekly sale too: http://www.humblebundle.com/weekly
:P

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Devlog update (2013-06-02) New script core
« Reply #5 on: June 02, 2013, 07:42:58 pm »
There is a bright future for Soldat scripters. And also the humble indie bundle is awesome too <3

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Devlog update (2013-06-02) New script core
« Reply #6 on: June 02, 2013, 08:09:13 pm »
Is it normal to be having orgasms?
www.soldatx.com.br - The brazilian Soldat community.

Offline NightKing

  • Major(1)
  • Posts: 13
  • Boom chicka wah wah
    • NightKing Videos!
Re: Devlog update (2013-06-02) New script core
« Reply #7 on: June 02, 2013, 08:31:26 pm »
Best of luck guys, I truly enjoy the game your work to improve. :D

Offline Nedi

  • Major(1)
  • Posts: 47
Re: Devlog update (2013-06-02) New script core
« Reply #8 on: June 02, 2013, 10:46:57 pm »
Lool Nice!

Offline DutchFlame

  • Camper
  • ***
  • Posts: 363
Re: Devlog update (2013-06-02) New script core
« Reply #9 on: June 03, 2013, 10:58:14 am »
wadafaq, im not good with scripts so i guess good job

shoozza on the other hand :@ YOU ADDICTED GAMING NOOB

Offline Tehbugerz0r

  • Soldier
  • **
  • Posts: 158
Re: Devlog update (2013-06-02) New script core
« Reply #10 on: June 04, 2013, 07:42:24 pm »
Damn, looks like I'm not quitting Soldat after all, if this version ever gets released.
I'm guessing it's possible to run separate SC3 and SC2 scripts at the same time, right?

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Devlog update (2013-06-02) New script core
« Reply #11 on: June 05, 2013, 04:58:24 am »
yes, otherwise it wouldn't have much sense
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 chox

  • Major(1)
  • Posts: 43
Re: Devlog update (2013-06-02) New script core
« Reply #12 on: June 05, 2013, 03:59:27 pm »

plx fix hat

Offline Adam

  • Camper
  • ***
  • Posts: 322
  • When someone you argue with has a good point.
Re: Devlog update (2013-06-02) New script core
« Reply #13 on: June 05, 2013, 04:34:05 pm »

plx fix hat
dem pixels need dem vectoring

Arguing with your girlfriend and you don't get a response for a few minutes

Offline DutchFlame

  • Camper
  • ***
  • Posts: 363
Re: Devlog update (2013-06-02) New script core
« Reply #14 on: June 05, 2013, 04:37:38 pm »
you are able to edit the hat size right? Might be a cheator!

Offline chox

  • Major(1)
  • Posts: 43
Re: Devlog update (2013-06-02) New script core
« Reply #15 on: June 05, 2013, 04:38:42 pm »
you are able to edit the hat size right? Might be a cheator!
nope i want devs to fix it, it's missing like 1 pixel when you face left and its longer when you face right

Offline TheOne

  • Soldier
  • **
  • Posts: 208
Re: Devlog update (2013-06-02) New script core
« Reply #16 on: June 06, 2013, 07:04:27 am »
Finally we found the reason why in our gathers bravo team (which is right-side located) has a better ratio.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Devlog update (2013-06-02) New script core
« Reply #17 on: June 06, 2013, 10:49:46 am »
Uuuuh! Awesome changes to the scriptcore which I'm not able to enjoy ;(
Keep up for the great, people appreciate it! :)

Offline Adam

  • Camper
  • ***
  • Posts: 322
  • When someone you argue with has a good point.
Re: Devlog update (2013-06-02) New script core
« Reply #18 on: June 08, 2013, 12:27:32 pm »
lol if it takes this long to post RC then I quess the new version won't be out till another year

Arguing with your girlfriend and you don't get a response for a few minutes

Offline chox

  • Major(1)
  • Posts: 43
Re: Devlog update (2013-06-02) New script core
« Reply #19 on: June 09, 2013, 10:50:23 am »
lol if it takes this long to post RC then I quess the new version won't be out till another year
yeah.. soldat is half-dead right now (waiting few hours to get proper cw)
and
1.6.2 to 1.6.3 took 7 months
1.6.3 to 1.6.4 is 13 months already and full release seems nowhere close, this is just sad what happens here