The online racing simulator
Lfs Pawn
(22 posts, started )
Lfs Pawn
Ya know, the title sounds funnier than I thought it would.

Anyway PAWN is a programming lanague know in the past as SMALL, if you have ever played VALVe's Counter Strike Mod for Half-Life, you might of heard of it. It has been used as a administrative mod for Counter-Strike in Admin Mod, AMX Mod, and Clan Mod.

So your thinking what does this have to do with LFS, right? Well, this thread is really for Mr. Scawen. I would love to see a true plugin interface for Live For Speed. Don't limit it to a Scripting System, or InSim. Give us full control over the engine. The plugin interface will work with PAWN with our much of a hassle, as that is really want PAWN is good at. Look at AMX Mod, the best example of what PAWN (Small) is capable of. Look at the plugin source code (Anything by my old friends Ludwig van, Space Dude, or Freecode.) to see what it can do in the right environment. I beg of you, give this a chance in LFS S2, don't let is slip to S3 or never.

Ok that's enough groveling, just look into it please, tell me what you think.

// Exciting Program Aint It?
main () {
new i, j, k;
new x, y, z;
for (i = 0; i < 100; i++) {
x++;
for (j = 0; j < 100; j++) {
y++;
for (k = 0; k < 100; k++) {
z++;
}
}
}
printf("X: %d\nY: %d\nZ: %d", x, y, z);
}

// Code is fictional, but could work. :)
#include <lfs.inc>

client_connect(id) {
new uname[24], pname[24], hostn[32];
uname[] = get_client_uname(id);
pname[] = get_client_pname(id);
hostn[] = get_server_name();
print_chat(-id, "%s (%s) host joined the server!", pname, uname);
print_chat(id, "Welcome to %s %s (%s)", hostn, pname, uname);
}

The issue with SmallC / PAWN / SMALL is that it doesn't appeal to the lowest common denominator, and it requires a certain level of coding abilities; which are higher than the simple scripting system.

Something I've worked on, on and off briefly, is implementing LUA 5.1 into an InSim client and letting that do some interesting things. Whilst thats still no where near the power you're after, because its limited by InSim / OutGauge, etc., I'd still deem it as too complicated for the masses.

I think the question I'm trying to bring out is;
What are you trying to acheive that is out of the scope of the various methods we have available?

Giving a certain level of access to the system would give us a fragmented LFS, and limiting it would probably merely leave us with only a slightly more powerful (albeit quicker and less resource intensive) system which is very close to what we can acheive now..
You right, it might be out of the reach of most of the users. But Small was my first programming language (Outside BATCH, but I don't think you could REALLY call that a programming language), and I found it VERY easy to pick up. I want nothing less the compleat control over what is going on in the game. I had so much fun in counter-stike where you could make it to something completely different. You could have server side nos, 300bhp 100 pounds front wheel MRT5's you could make the LX8 by your selfs if you wanted to. I think that is not out of reach with Live For Speed. It could be done, and it could be giving to the masses with PAWN in an easy way with out them having to learn datatypes the hard way, or memory management (for the most part). You don't even have to initialize variables with SMALL ... eh PAWN. Just think of the fun you could have with it!
Eheh, I think you underestimate the integration & modification that would require. You are not talking about an admin interface there; you are talking about an entirely embedded scripting API.
#5 - filur
From the features page it seems there's no object orientation at all, this is simply not acceptable.
I hope you're not subtly suggesting ECMAScript as an alternative, filur

Edit: Sorry, I didn't mean to turn this into a battle of the languages. Ferite anyone?
Quote from Dygear :You could have server side nos, 300bhp 100 pounds front wheel MRT5's you could make the LX8 by your selfs if you wanted to. I think that is not out of reach with Live For Speed. It could be done, and it could be giving to the masses with PAWN in an easy way with out them having to learn datatypes the hard way, or memory management (for the most part). You don't even have to initialize variables with SMALL ... eh PAWN. Just think of the fun you could have with it!

From my astronauts, few hundred mile high, view of LFS' infrastructure, the proposed change would rely on further infrastructural changes to LFS.

All in all its a very cool idea, but effectively this would be [limited] modding, which I believe has been thoroughly discussed? Scawen has demonstrated an interest in modding - but only at the appropriate time.

I agree it would be cool to see a more capable [scripting] language embedded in LFS, but it appears as if the team are doing it their own way (at least for now)
I think it would have saved alot of (future) development time if an existing language would have been used for the 'LFS script system', I dont know how easy pawn would be to implement, but for example implementing LUA is extremely easy and it is very lightweight too...

As long as the script system has a proper language and enough functionality it could be used to do propably almost anything you could need it for. I dont see why you couldn't have things like ability to create objects in the game world and control them, like make an "AI" pace car or trackside marshalls for example... But a 'proper' language would be required, and I'm afraid making an entirely new one from scratch, as Scawen seems to be doing, is going to be a massive amout of work so we might never see the full potential of such system.
-
(thisnameistaken) DELETED by thisnameistaken
Quote from Anarchi-H :Eheh, I think you underestimate the integration & modification that would require. You are not talking about an admin interface there; you are talking about an entirely embedded scripting API.

Yea, I might of. But still, it would be cool.

Quote from filur :From the features page it seems there's no object orientation at all, this is simply not acceptable.

Yea, that is a point, but I ... don't ... think ... it's needed.
/me runs away

Quote from the_angry_angel :I hope you're not subtly suggesting ECMAScript as an alternative, filur

Edit: Sorry, I didn't mean to turn this into a battle of the languages. Ferite anyone?

Ah you know what I don't care, for the most part I just like pawn b/c it was very easy for myself to learn, what language it is in. I just want the idea to be done.

Quote from Kegetys :I think it would have saved alot of (future) development time if an existing language would have been used.

Fully agree.

Quote from thisnameistaken :I hated the way CS servers became all about running three dozen different mods at the same time. CS server admins are all stupid morons, every one of them.

Eh, ok ... back away from the coffee and no one gets hurt.
real code in lfs ? sounds fun
maybe we could also get a diff type that just opens up a window to put c code into (and no im not kidding)
Quote from Kegetys :I think it would have saved alot of (future) development time if an existing language would have been used for the 'LFS script system'

Sing it again brother. At the end of the day, its not our baby though

Quote from Dygear :Ah you know what I don't care, for the most part I just like pawn b/c it was very easy for myself to learn, what language it is in. I just want the idea to be done.

Sorry Dygear I didn't mean to provoke that reaction.

Quote from Shotglass :real code in lfs ? sounds fun
maybe we could also get a diff type that just opens up a window to put c code into (and no im not kidding)

Sarcasm?
Quote from the_angry_angel :Sarcasm?

not at all i think i would greatly enjoy finding the best way to figure out diff lock and torque split settings from a whole bunch of data lfs provides

id probably spend more time tweaking my diffs than driving if something like this ever gets put into a sim
Quote from Shotglass :not at all i think i would greatly enjoy finding the best way to figure out diff lock and torque split settings from a whole bunch of data lfs provides

id probably spend more time tweaking my diffs than driving if something like this ever gets put into a sim

You know, I did not even consider it to that level, yes that WOULD be awsome. Sonsider the pretty graph that it could also make . God we are going over board, but it's nice to see some support for it.

Angle, don't worry about my reply, it was not written in a harsh typing manner, although it came out that way. Sorry. Really when it comes down to it, I want nothing less then real time support for evey even in the system. I think Pawn, is the best lanague for that. I'm sure you guys could bring up others. Java, real C++, but the learning curve is much to steep.
Double post, sorry (wrong button), everything structured bellow
I think that the easiest programming language for the masses is Pascal, it is structured in a way that leet developers can code and noobs still understand it..

like :

Program MyProg;
uses LFSlib;

Var LapCount:integer;
FuelLoad:Real; {(this is a comment) Real is a decimal value, like 1,3}

Begin

WriteChat("Fuel Load per lap= ", FuelLoad/LapCount);

End.

or with functions


Program MyProg;
uses LFSlib;

Function GetFuel(Laps:integer,Fuel:real):Real
begin
return fuel/laps;
end;

Var LapCount:integer;
FuelLoad:Real; {(this is a comment) Real is a decimal value, like 1,3}

Begin

WriteChat("Fuel Load per lap= ", GetFuel(FuelLoad,LapCount));

End.

or with procedures (Void in C, Sub in VB)


Program MyProg;
uses LFSlib;

Procedure WriteFuel(laps:integer,fuel:real)
begin
WriteChat("Fuel Load per lap= ", fuel/laps);
end;

Var LapCount:integer;
FuelLoad:Real; {(this is a comment) Real is a decimal value, like 1,3}

Begin

WriteFuel(FuelLoad/LapCount);

End.

See? as it has to be formated like that, with no variables in the middle, and all declared are alot easier for a noob to understand, and there is no wierd % # chars in write to chat procedures.

I thought about Visual Basic as it is my first language, but, for noobs, a well structured programming language is alot easier to learn.
Quote from the_angry_angel :I hope you're not subtly suggesting ECMAScript as an alternative, filur

Edit: Sorry, I didn't mean to turn this into a battle of the languages. Ferite anyone?

Absolutely not. :nol2:

Ferite looks neat.
I think sticking to a C style syntax would be best. I have the java namespace computer.system.out.print("That was awfully convoluted!"); I also don't like python b/c it does not use braces, any language that does not use braces is just odd.
#18 - nilo
Quote from Dygear :I also don't like python b/c it does not use braces, any language that does not use braces is just odd.



Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import braces
File "<stdin>", line 1
SyntaxError: not a chance
>>>

Quote from Kegetys :I dont know how easy pawn would be to implement, but for example implementing LUA is extremely easy and it is very lightweight too...

Angel, get the idea from here did ya?

Quote from the_angry_angel :
Quote from Dygear :Ah you know what I don't care, for the most part I just like pawn b/c it was very easy for myself to learn, what language it is in. I just want the idea to be done.

Sorry Dygear I didn't mean to provoke that reaction.

Yeah, I did not mean it quite the way it came out. I meant I did not care what language was used as long as it happened.

Quote from filur :Ferite looks neat.

Holy crap, yes it does!


Yes, I know how much I bumped this thread, but please consider this a state of the 'core'. After all, lots as happened.
Quote from Dygear :Angel, get the idea from here did ya?

I'd already started work on doing something with lua and insim waaay before this thread I believe I mentioned it several weeks prior in one of kegetys threads by accident - but that was quite a while ago..

The thing is that "embedding" these languages is fairly trivial (in comparison to making your own) and creating something like luaLFS or feriteLFS or whatever (whatever you want to call them) is a very low amount of work once you've got the C backend done (which can be acheived nicely in a few hours) the only interesting pain is figuring out how to expose the insim packets to the underlying language without being too complex

Quite frankly I'd still love to see these in LFS themselves, after all things which use the MIT/X/equiv. licences allow for the code to be included in proprietory projects
Quote from nilo :

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import braces
File "<stdin>", line 1
SyntaxError: not a chance
>>>


Lol, that was great.

Quote from the_angry_angel :The thing is that "embedding" these languages is fairly trivial (in comparison to making your own) and creating something like luaLFS or feriteLFS or whatever (whatever you want to call them) is a very low amount of work once you've got the C backend done (which can be acheived nicely in a few hours) the only interesting pain is figuring out how to expose the insim packets to the underlying language without being too complex

Quite frankly I'd still love to see these in LFS themselves, after all things which use the MIT/X/equiv. licences allow for the code to be included in proprietory projects

I just looked into Ferite again, as I only gave it a glancing look last time, and I have to say, it's pretty cool, but I've not seen anything about using it as an embedded language and I feel that getting it to that point would take quite long.

We've seen many types of packet exposer in many of the current incarnations of InSim apps. I was wondering what everyone thought was the best system they have seen thus far. Does anyone think we have reached a state where plugin programming for any of these systems is useful, easy, and intuitive?

For me this was lurLFSd by, that zany Sweed (meant with much love), filur. I'm still sooo upset that he has not released this, considering that I've been talking about it for the last 3 years at least, and it was ready to be used by people for I think 2 and a half years.
-
(DarkTimes) DELETED by DarkTimes
Quote from filur :From the features page it seems there's no object orientation at all, this is simply not acceptable.

It seems that my old AMX Mod X devs have been quite busy ... Their programming language is called SourcePAWN and it has some intresting ways to add native functions to the plugin interface.

Lfs Pawn
(22 posts, started )
FGED GREDG RDFGDR GSFDG