[Plugin] Squirrel Wrapper [0.3z Only]
#1

Quote:
Preface: I started to write this project 2 years ago but I stopped this project because of my school 1.85 years ago. I saw the part of codes belong to my Squirrel wrapper and started to rewrite again. I wrote it again.

What is this Project?
- I made this project for people who is bored of the noob Pawn. You can use both C++ and C to write more powerful things then Pawn but this is hard to do. You can ask me: "Why you chose Squirrel, not .Net". First I hate Windows. Second I need a dynamic language.

Why Squirrel?
- Squirrel is a high level imperative, object-oriented programming language, designed to be a light-weight scripting language that fits in the size, memory bandwidth, and real-time requirements of applications

Timings?
According to my measurements, Squirrel finishes jobs before Pawn. (100-200 ms) [Thanks SAMPGDK]

Features:
- Resource System = [ Interactive coding with lots of files. ] [Inspired by MTA]
- Element System = [Every Object is an element in my plugin. ] [Inspired by MTA]
- Event System = [ Interactive coding with lots of events ] [Inspired by MTA]
- Command System = [Easy to handle commands.] [Inspired by MTA]
- Integrated XML & File Functions
- It's open to develop. You can both develop the SQWrapper and your own module for it.
- OOP!


Downloads:

Server Folder: Download
Source (sqsrc, sqdevkitsrc, sqmysqlsrc) : Download

Examples:
Lets make a test resource.
-> Create a folder in squirrel-mods/resources named "test"
-> Create two file in "test" named "meta.xml" "test.nut"
-> Open "meta.xml" and write:
Код:
<meta>
	<info name="Test SQWrapper" author="Skyline." version="1.0" description="SQWrapper..." />
	
	<script src="test.nut" />
</meta>
-> Open "test.nut" and write:
Код:
class HelloClass
{
	static function onResourceStart()
	{
		// Source: Started resource, in this case this resource because we've added the event for just this resource.
		print("Hello from " + getResourceName(source));
	}
}

addEvent("onResourceStart", getThisResource(), HelloClass.onResourceStart);

function onPlayerConnect()
{
	
	// Source: The Player Element
	sendClientMessage( source, 0xFFAE00FF, "Hello!");
	return true; // It's important.
	
}
addEvent("onPlayerConnect", getRootElement(), onPlayerConnect);


function onPlayerDisconnect( reason )
{
	
	// Source: The Player Element
	sendClientMessage( source, 0xFFAE00FF, "Bye!");
	return true; // It's important.
	
}
addEvent("onPlayerDisconnect", getRootElement(), onPlayerDisconnect);
-> You can start resource with input console "baslat test" || "start test"
-> You can start resource at server-start squirrel-mods/squirrel.conf

Notes:
-> I will add more examples.
-> This project is beta.
-> This project works under only linux. (Now)
Reply
#2

This looks quite interesting. It would be fun writing gamemodes in Squirrel.
Reply
#3

Yes, all functions is implemented.
Reply
#4

Why would someone use squirrel while there is SAMPGDK ?
Specially if plugins needs to be updated on every single samp server update.
Do you think this is more powerful than C++ ? It's not even cross-platform...
In my option this is good for practice but don't waste your time to implement it on windows..
Reply
#5

What about plugin for Windows?
Reply
#6

lol why do you say it's more powerful than any other? Please explain eh??
But I'm happy that now many choices have the programmers to start with.
Reply
#7

I never said its more powerful than the others. I just said that writing mod in C++ is hard because of the memory management. Please dont make laugh me. I just said its more dynamic and powerful than the Pawn.
Reply
#8

Quote:
Originally Posted by LeaveMe
Посмотреть сообщение
Why would someone use squirrel while there is SAMPGDK ?
Specially if plugins needs to be updated on every single samp server update.
Do you think this is more powerful than C++ ? It's not even cross-platform...
In my option this is good for practice but don't waste your time to implement it on windows..
Please read my post again. I did not said that its more powerful than the C++. But squirrel is more dynamic than the C. 0.3z only because there is new callbacks. Its like sampgdk you dont need update if you dont want to use new callbacks. If you are good at C, you knew that memory management is hard to newbies. Writing good mod in C++ is more harder.
Reply
#9

Quote:
Originally Posted by Rancho
Посмотреть сообщение
Please read my post again. I did not said that its more powerful than the C++. But squirrel is more dynamic than the C. 0.3z only because there is new callbacks. Its like sampgdk you dont need update if you dont want to use new callbacks. If you are good at C, you knew that memory management is hard to newbies. Writing good mod in C++ is more harder.
It's not more dynamic than C++ and as you know this wrapper doesn't allow to use current includes, or edit current pawn scripts. However this is not a big deal.
I'm telling you that if there is a developer good enough that doesn't need to edit, or use current sa-mp scripts then he is not a newbie and he would choose C++ not a wrapper to another wrapper which is not even cross-platform.

Take a look for similar plugins made for other languages to get what I mean!
Anyway good luck with it!
Reply
#10

Squirrel is easy to learn and way better for scripting than pawn.

The major problem with all these wrappers is people start something up, release a half done job and disappear.
Reply
#11

This looks great, but you should consider releasing the server for windows.
Reply
#12

I don't trust these 'other-language' plugins. Now it's cool but when the new version come out we will need to wait for developer to make a plugin that will work with new version and that means the server will be offline until it will be finished.
Reply
#13

Quote:
Originally Posted by LeaveMe
Посмотреть сообщение
It's not more dynamic than C++ and as you know this wrapper doesn't allow to use current includes, or edit current pawn scripts. However this is not a big deal.
I'm telling you that if there is a developer good enough that doesn't need to edit, or use current sa-mp scripts then he is not a newbie and he would choose C++ not a wrapper to another wrapper which is not even cross-platform.

Take a look for similar plugins made for other languages to get what I mean!
Anyway good luck with it!
http://en.m.wikipedia.org/wiki/Dynam...mming_language := What does dynamic programming languagr mean.

Thanks for your reply.
Reply
#14

Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
I don't trust these 'other-language' plugins. Now it's cool but when the new version come out we will need to wait for developer to make a plugin that will work with new version and that means the server will be offline until it will be finished.
Makes sense, it falls in line with the downfalls of memory hacking plugins in terms of updating that could leave a sever in the dark ages when a server crash exploit forces a SAMP update. I've been there and it is a nightmare situation this is probably not a particularly viable option for a public server if that is the case.
Reply
#15

just one question, how will functions from other plugins interact with this plugin ? so that we can use them as natives as in we do in PAWN right now. (hope i am clear) e.g: sscanf, streamer etc..
Reply
#16

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
I've been there and it is a nightmare situation this is probably not a particularly viable option for a public server if that is the case.
Good point! This is exactly what I meant!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)