[GameMode] Y-Core + Y-RP development thread
#21

@JesterlJoker: Normal compiler has lacks some major features and bugfixes such as 4 dimenions, sizeof 2nd dimension works as expected, ternary strings don't bug out, some memory usage fixes as well
Reply
#22

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
Код:
// Wrong
Function() {
	
}

// Right
Function()
{

}
You're aware that both are right?(And will compile fine) Right?
The only difference is that the second either a waste of space or is used for people to say how "good they are at coding that they made a 30k line code" when most of their code is coded like this;

Dunno why people say the second is "clearer", both are clear, just that the first has less "wasted lines"

You can also code like so
Код:
Code { 

    // code

}
I know that its a coding style, but it's not conventional, its randomatic and you haven't limited it to the code on your repo but generally emphasized that coding should be done with line breaking brackets only. (which is in my personal opinion, wrong and I rather avoid from using a library that forces me to do break lines)

Moreover, y_inline afaik supports both inline and line-broken brackets (like foreach)
It's simply a personal preference, all the 'pros' use the first one though.
Reply
#23

Nice work buddy.
Reply
#24

Quote:
Originally Posted by Paulice
Посмотреть сообщение
It's simply a personal preference, all the 'pros' use the first one though.
Professionals? Look the definition up please, it's not what you think it is
Reply
#25

Quote:
Originally Posted by Paulice
Посмотреть сообщение
all the 'pros' use the first one though.
No.
They're mixed, some even like to ignore brackets at all. (You can, if you wish to relay on correct tabbing)
Some even like to write a working code first and then make it faster, some write straight away the fastest, efficient and least space consuming code they can write.

imo, one should write in his own coding style, and those who it annoys them should hand-rewrite the code to their style if deemed necessary.


EDIT: if I already replied, as a reply to the other replies that quoted my reply, I just feel that a line from reply was missed.
Quote:

I know that its a coding style, but it's not conventional, its randomatic and you haven't limited it to the code on your repo but generally emphasized that coding should be done with line breaking brackets only.

I took a look at the repo again and didn't see that @Misiur added a disclaimer and I'm afraid many will mistake that his notes are solid and relevant to any coding done in pawn for samp. (by the parts of generalized //wrong and //right comments)
Reply
#26

Sounds good.
Reply
#27

Interesting! Good job!
Reply
#28

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
No.
They're mixed
They're mixed my as*. The majority of the experienced users, which can be refereed to as "pros" compared to "newbies", use the first one. And NO, PAWN is the last language I'm considering (no pros here, except for the samp gods).
Reply
#29

Quote:
Originally Posted by ******
Посмотреть сообщение
Edit: My link to a certain site for very short public messages was blocked. Direct image link: https://pbs.twimg.com/media/CvH9gfFWcAA2knK.jpg and search for "whichever brace style you use, don't do this".
Shared that meme a few months ago
http://forum.sa-mp.com/showpost.php?...postcount=4340
Reply
#30

Quote:
Originally Posted by Paulice
Посмотреть сообщение
It's simply a personal preference, all the 'pros' use the first one though.
retard?
Reply
#31

YSI is a huge library, and it's very confusing at f̶i̶r̶s̶t̶ every sight. If you want someone to use it you better provide awesome documentation and examples or it's not going to be used. If you take a look at the most overused gamemodes you can see something in common, it's far from well written but you can mostly understand what's going on simply by reading the script and following the logic. I give you props for the effort but who's going to use it? Everything I see there can be written using basic pawn code without epic scale hacks we see in YSI libraries.
Reply
#32

Quote:
Originally Posted by MicroD
Посмотреть сообщение
YSI is a huge library, and it's very confusing at f̶i̶r̶s̶t̶ every sight. If you want someone to use it you better provide awesome documentation and examples or it's not going to be used. If you take a look at the most overused gamemodes you can see something in common, it's far from well written but you can mostly understand what's going on simply by reading the script and following the logic. I give you props for the effort but who's going to use it? Everything I see there can be written using basic pawn code without epic scale hacks we see in YSI libraries.
I wouldn't call YSI a hacky library, more of a logistical one.


YSI is actually well documented, it has entire threads documenting specific parts of YSI and even a wiki.

The reason why some people aren't using it, is because people don't read the documentations and/or understand them well.
People understand what is y_commands, there is minimal logic needed there.

****** created many tutorials which Misiur restored,

I'll make the effort and give links to some of the documentation explaining its basic purpose in as simple words as possible. (I might hit and I might a bit miss)
y_iterate - Basically, to make faster loops that contain random data.
foreach - With foreach you can loop through existing things in samp (through players/npc's) (uses y_iterate)
y_iterate (foreach 3.0) - Now you can use foreach with your IterateArrays (simpler look and shorter)
y_timers - Nicer looking timers.
y_colours - Pre-defined colors, so you don't have to.
y_dialog and y_inline - y_dialog is supposedly an easier way to make dialogs and y_inline (which I think a very useful include) is basically enabling you to create callbacks right where you are (without going back up to add a "forward line" and then back down to add a "public" or somethin') -- useful for timers & t/pquery (No forgetto to use the include for it samp-mysql-yinline-include)
y_ini - a faster ini filesystem include, was created to be used over dini (which is and still slow)
y_areas - An include that makes your life easier to work with areas with different shapes.
y_als - Just an easier way to hook callbacks than the traditional approach.
y_bit - There are packed strings, now you can pack entire multi-dimensional arrays!
y_classes - You normally can add classes only when the gamemode starts, now you can add classes whenever you want.
y_flooding - Limiting the amount of simultaneous connections from a single ip
y_groups - An easier way to manage different groups (admins, helpers, gangs, factions), you can add specific commands to each group.
y_text & y_language - Pretty self-explanatory, tools given to easily work with different language that you want to support on your server.
y_testing - never really digged into it, a quick view into the thread, looks like an easier way to test functions.
YSI Secrets - Just some extra, if the above wasn't enough.


Undocumented: y_utils - An include with different useful functions
Undocumented: y_bintree - https://en.wikipedia.org/wiki/Binary_tree | http://ysi.wikia.com/wiki/Library:YSI%5Cy_bintree
According to the wiki there is an unresolved bug.
Undocumented: y_jaggedarray - Resizes an array, explaining the poorly explained example:
Код:
new arr[5][7]; // 5 * 7 = 35 cells total.
// [0][7], [1][7], [2][7], [3][7], [4][7]
Jagged_Resize(arr, {2, 4}, {3, 8});
// resizes specific slots to specific sizes, so the new sizes are now
// [0][7], [1][7], [2][4], [3][8], ([4][7] = 35)
Undocumented: y_bitmap - I have no clue how it draws a shape, probably with 3dTextLabel.
QWERTYUIOP - Macro (one letter - useful) functions
y_lock - Binds to run on a single ip (locks from being run on other ip than the specified.)
y_va - No more a need to write "format" and then use "SendClientMessage", with this include you can do all this in one line.
y_debug - If you want to write better print()
Undocumented: y_malloc - I think was documented, but not anymore.
y_stringhash - If you have big arrays with many options that you use frequently, this include will be very useful. Basically converting the string into numbers, comparing integer is much faster than comparing string with string.
Undocumented: y_hashmap
y_hooks, y_playerarray & y_master (Wiki: y_hooks, y_master) ((poorly or un)documented: y_playerarray) - Haven't worked with y_hooks, but by the only documentation exists it looks like its simpler to hook with it than y_als, but cannot be recalled like in y_als multiple times. y_master looks like an include that completes the circle of working with y_hooks.
Undocumented: y_td
y_remote - Normal compilers don't give much errors if you used CallRemoteFunction incorrectly, this include fixes it + changes the way you call remote functions.
https://sampforum.blast.hk/showthread.php?tid=570949&highlight=y_cell (Wiki) - A set of functions to play with binary, bits, bytes and nibbles.
y_extra - Pretty self explanatory, adds the functions listed for you.
y_zonepulse - Flashing zones on the map like in Single Player GTA San Andreas
y_races - Self explanatory, helps you create races easily.
y_php - I'd say, not very documented. Why would one should use it, how to use it isn't documented, but stated that examples are available within YSI files.
Undocumented: y_files (not finished as Wiki suggests)
Undocumented: y_xml
Undocumented: y_playerset
Undocumented: y_writemem
y_amx - Get information about functions
y_svar & y_uvar (Wiki: y_svar) - I have no idea whats the difference between this and static, but it saves server data or user data and loads it after the server restarts or shuts down/crashes and is loaded again.
y_users (Wiki) - Easily work with player data, uses y_ini and simplifies the work with player management for you. (registration, login, load, unload, reload)

I hope I nailed it.


(full list - https://sampforum.blast.hk/showthread.php?tid=571161 )
(An entire wiki - http://ysi.wikia.com/wiki/YSI_Wiki (funny thing: y_classes has the content of y_cell))
Reply
#33

I actually posted the same message as above though. So my original post is a summary of the above post.

Quote:
Originally Posted by Logic_
Посмотреть сообщение
Wrong, it's mainly because people are unaware of it's solutions and features it provide. Lack of awareness is the most common and first issue which is the base of other issues.

What one can do is put YSI tutorials in a link along with their examples on their thread. And that one individual only posts on their thread, and everyone puts a link to it in their (forum) signature, which will get attention of a lot of people.
Reply
#34

Nice to see some discussion going. Now, I have a question: should I allow single player to join more than 1 faction at once? It could be a little different than other gamemodes, though it creates problems with "standard" commands such as faction chat - should each faction have a dynamic command for their chat? It'd get confusing for new players. Opinions?
Reply
#35

Nope, as long as the script is simple to use, people will like it.
Reply
#36

Dynamic faction colours! *colours subject to change

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)