SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 16/11/2018, 11:22 PM   #11
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: PawnPlus

PawnPlus v0.11.0 released!

Collections
  • List iterators return the index via iter_get_key. New iterator functions: iter_sizeof, iter_tagof, iter_sizeof_key, iter_tagof_key.
  • Movement functions take optional parameter to specify the number of steps.
  • list_find for searching in lists (uses variant comparison).
  • Other functions for maps and lists to create iterators at specific positions.

Memory management
  • It is no longer possible to directly move GC-objects between the local and global pool. Instead, acquire and release operations are used to increase or decrease the reference count stored in the object. Only objects having the count set to 0 will be in the local pool (and thus collectible). (#11)
  • As a consequence, GlobalString, GlobalVariant, and GlobalIter tags are removed, as well as the corresponding tag conversions. acquire and release should be used explicitly to control the movement. You also shouldn't need to delete these objects directly, if you use these operations correctly.
  • Guards use acquire and release to control the lifetime of the guarded object. For objects controlled by the garbage collector, this manipulates the reference count. For other objects, it calls delete_deep on them.
  • Generic functions pawn_ref and pawn_unref to create Ref<T> without explicit retagging.
  • Added handles to manage standard objects (like lists and maps) using garbage collection. Handles are garbage-collected, and delete the object when they are collected.
  • Handles and guards do not call the destructor if the object was already destroyed via some other way (only works for containers and tasks).

Tasks
  • Tasks can store variants (i.e. values of any type and tag). Generic tasks are possible now as well.
  • task_continue_with and task_continue_with_bound to specify a function which should be called when the task is completed (and which might be used for a new task).

Tags
  • Tags derived from generic tags cannot have their operations redefined.
  • tag_element to obtain the element tag from a generic tag.
  • Generic tags no longer have to be explicitly defined. Instead, all generic functions are represented as separate macros.
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Old 31/12/2018, 12:33 PM   #12
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: PawnPlus

PawnPlus v0.11.1 released!

Error handling
  • By default, any error caused by a native function will be reported via a raised AMX native error, in addition to a message to the log. This happens when a function is expected to produce a result based on its description, but fails to do so (because of invalid arguments, invalid state of the object etc.), and the error can be prevented. Do not expect that native functions return 0 or some other error code; instead, make sure the errorneous call never happens in the first place.
  • pp_error_level can set a script-wide error level that is sufficient for raising an AMX error. Usable values are error_logic, error_formal, and error_none. The first level is set by default, the last can be used to disable AMX errors altogether. Logic errors occur when you work with invalid data in your code (references to nonexistent objects, invalid indices etc.); these can be fixed by making sure you properly initialise your variables or check for exceptional values. Formal errors occurs when you call a function in a certain form that is not expected, like a mismatch in the number of arguments for pawn_call_public or an invalid function name (these errors were already reported prior to this version); these errors are usually fixed by fixing the native call itself.
  • When an error occurs in the script, public pp_on_error can be used to handle it before an AMX error is raised. The source, message, and level is provided to the callback, which can specify the value returned from the erroring function. Returning true from the callback will suppress the error.

Containers
  • Maps can be switched to ordered mode via map_set_ordered. When this is used, all pairings in the map will be ordered based on the key, and all newly added values will conform to this ordering. All iterators to the map are also invalidated.
  • Instead of the hash operation, ordered maps use the lt operation (less than) to compare keys. Therefore, values with different tags are always comparable (although the result is only determined by their tags, not by their values), and arrays are compared lexicographically via their cells. Thus string keys can are also comparable.
  • var_get_arr will, when the offsets are specified, copy the whole range of cells starting at the offsets instead of just the first cell.

Tasks
  • task_set_result will return the value returned (or yielded) from the last handler that was executed in response to the task.

AMX
  • amx_end_fork renamed to amx_fork_end.
  • amx_parallel_begin and amx_parallel_end (used in the macro amx_parallel). This function sets the debug handler for the AMX that, when called (via the BREAK instruction), pauses the execution of the AMX and schedules it to be resumed on the next tick. The number of BREAK instructions that must be used to pause the machine can be also specified. With the sufficient debug level, they will be emitted after every statement (or you can use #emit break). This makes long loops appear to run in parallel with the server and the script (but they will be less efficient than true threaded code).
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Old 01/01/2019, 12:28 PM   #13
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 144
Reputation: 3
Default Re: PawnPlus

When I include pawnplus my compiler always crashes
NoteND is offline   Reply With Quote
Old 01/01/2019, 12:30 PM   #14
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: PawnPlus

Quote:
Originally Posted by NoteND View Post
When I include pawnplus my compiler always crashes
You should use the new version of the compiler, here.
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Old 01/01/2019, 01:11 PM   #15
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 144
Reputation: 3
Default Re: PawnPlus

Quote:
Originally Posted by IllidanS4 View Post
You should use the new version of the compiler, here.
still crashes
NoteND is offline   Reply With Quote
Old 04/01/2019, 11:23 PM   #16
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: PawnPlus

Quote:
Originally Posted by NoteND View Post
still crashes
It should work; check if you have the correct pawnc.dll.
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Old 20/02/2019, 10:00 AM   #17
Jay_
Gangsta
 
Jay_'s Avatar
 
Join Date: Jul 2009
Posts: 653
Reputation: 197
Default Re: PawnPlus

Err wow, nice work. Not sure how why this hasn't received more recognition.
Jay_ is offline   Reply With Quote
Old 24/02/2019, 10:09 PM   #18
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: PawnPlus

Quote:
Originally Posted by Jay_ View Post
Err wow, nice work. Not sure how why this hasn't received more recognition.
Thanks! Well, I am glad people are using it; the recognition may be greater in other places than on this forum.
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Old 11/04/2019, 11:51 PM   #19
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: PawnPlus


PawnPlus v1.0.0 coming!

Watch the GitHub repository for more updates!
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode

Last edited by IllidanS4; 20/04/2019 at 09:33 AM.
IllidanS4 is offline   Reply With Quote
Old 20/04/2019, 09:34 AM   #20
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 336
Reputation: 255
Default Re: PawnPlus

PawnPlus v1.0.0 released!

Miscellaneous
  • pp_version, pp_version_string, pp_raise_error, pp_module_name.
  • Locale-specific functions can be configured with pp_locale (affects things like str_to_upper and regex).
  • AMX subhook variables are no longer exported.
  • All natives that take an address inside the AMX check its validity.

Handles
  • Several new functions to control the activity of handles.
  • Handles are now immutable.
  • All GC-objects can provide their lifetime handle.

Pawn API
  • pawn_nameof macro can be used to convert a symbol or a tag name to a string (with checking).
  • pawn_cast macro (invokes implicit tag conversion operator).
  • pawn_try_call_native and pawn_try_call_public (suppress and return errors).
  • pawn_native_exists, pawn_native_imported, pawn_public_exists.

AMX API
  • amx_tailcall can replace the caller stack frame with the current stack frame.
  • amx_handle to control the lifetime of an AMX instance.
  • A function can be called in any AMX instance via amx_call_native/amx_call_public.
  • Additional support for native and public functions inspection.
  • Public and native functions names can be encoded in a two-cell packed string via amx_encode_public_name and amx_encode_native_name for faster calling. Custom values can also be specified.

Errors
  • Unhandled C++ exceptions in natives will be caught and reported.
  • Fixed several bugs related to error handling and conflicts with SAMPGDK.

Strings
  • Regular expressions (match, extraction, replacement).
  • str_format upgraded with new specifiers and syntax for positional arguments.
  • All functions now accept packed strings as well.
  • ConstAmxString added.

Variants
  • var_addr can be used for interop with native functions, similarly to str_addr.
  • Empty array variants are now recognized and produced instead of null variants.

Debug API
  • A multitude of functions to access the debug information produced by the Pawn compiler (at least -d2 is necessary).
  • Allows inspecing all variables and functions. Can be used to set variables (local or global) or to call any Pawn function.

Containers
  • Reduced unnecessary copying of objects.
  • Functions like list_new_args now store all the tags correctly.
  • list_resize, list_find, list_find_last, list_sort.
  • Variants and iterators have functions for both single-dimensional and multi-dimensional access to stored arrays.
  • Simple iterators: iter_range, iter_repeat, var_iter.
  • *_remove_deep and iter_erase_deep (removes the element and releases the object).
  • iter_swap, iter_can_reset, iter_can_insert, and iter_can_erase.

Tasks
  • task_detach useful for fire-and-forget calls. Creates a new context, so inner asynchronous calls will not pause the caller functions.

Threads
  • thread_fix to synchronise the function with the main thread, if called from another. Useful for code called from RCON or console.

Math API
  • Functions for signed and unsigned arithmetics (with overflow checks). signed: and unsigned: tags for simple usage.
  • math_random, math_random_float, math_round, math_floor, math_ceiling, math_truncate

C API
  • A simple mechanism for manipulating PawnPlus from other plugins.
  • Supports addons, tags, strings, variants, lists, linked lists, and maps.
  • Include ppcommon.h.
__________________
PawnPlus
YSF
Yet Another Lua Plugin
Long Function Names
 i_quat.inc 


kingsofsa.cz:8888 running Cinematic Mode
IllidanS4 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] PawnPlus IS4 Plugin Development 34 26/09/2018 09:02 PM
[Help] PawnPlus IDE Manda21 Scripting Help 4 29/10/2016 01:41 PM
[Tool/Web/Other] [0.1] PawnPlus IDE - PAWNO alternative WopsS Tools and Files 62 13/04/2016 10:32 PM
[Tool/Web/Other] PawnPlus IDE - PAWNO alternative WopsS Tools and Files 94 14/01/2016 09:32 PM


All times are GMT. The time now is 03:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.