SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/11/2018, 12:22 AM   #11
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 342
Reputation: 230
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 online now   Reply With Quote
Old 31/12/2018, 01:33 PM   #12
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 342
Reputation: 230
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 online now   Reply With Quote
Old 01/01/2019, 01:28 PM   #13
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 101
Reputation: 0
Default Re: PawnPlus

When I include pawnplus my compiler always crashes
NoteND is offline   Reply With Quote
Old 01/01/2019, 01:30 PM   #14
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 342
Reputation: 230
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 online now   Reply With Quote
Old 01/01/2019, 02:11 PM   #15
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 101
Reputation: 0
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 05/01/2019, 12:23 AM   #16
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 342
Reputation: 230
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 online now   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 35 26/09/2018 10:02 PM
[Help] PawnPlus IDE Manda21 Scripting Help 4 29/10/2016 02:41 PM
[Tool/Web/Other] [0.1] PawnPlus IDE - PAWNO alternative WopsS Tools and Files 62 13/04/2016 11:32 PM
[Tool/Web/Other] PawnPlus IDE - PAWNO alternative WopsS Tools and Files 94 14/01/2016 10:32 PM


All times are GMT. The time now is 10:20 PM.


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