SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 15/11/2013, 08:21 PM   #11
StuartD
High-roller
 
StuartD's Avatar
 
Join Date: Jul 2012
Location: United Kingdom
Posts: 1,107
Reputation: 265
Default Re: easyDialog.inc - Dialogs made easier!

This is a nice re-release Emmet_, It is well explained as well. I may use this.
__________________
StuartD is offline   Reply With Quote
Old 16/11/2013, 02:29 AM   #12
mike358015
Little Clucker
 
Join Date: May 2013
Posts: 6
Reputation: 0
Default Re: easyDialog.inc - Dialogs made easier!

Because this calls the functions directly, not browsing all the if-else or switch statements one by one, can this be faster than normal method?

Anw, have been using your older version of this, and I have to say, it's pretty much better and easier to manage than the normal way. Thanks for the nice includes, Emmet_.
mike358015 is offline   Reply With Quote
Old 16/11/2013, 02:45 AM   #13
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,314
Reputation: 1171
Default Re: easyDialog.inc - Dialogs made easier!

Quote:
Originally Posted by mike358015 View Post
Because this calls the functions directly, not browsing all the if-else or switch statements one by one, can this be faster than normal method?
The speed is too small to be effectively measurable so it is really irrelevant what is relevant is the ability to organize dialogs in their own functions which is beneficial design wise. I would use y_inline/y_dialogs myself but this method lives up to production quality standards and is good for both beginner and intermediate scripters alike.
Pottus is offline   Reply With Quote
Old 16/11/2013, 01:08 PM   #14
Emmet_
Guest
 
Posts: n/a
Default Re: easyDialog.inc - Dialogs made easier!

Quote:
Originally Posted by mike358015 View Post
Because this calls the functions directly, not browsing all the if-else or switch statements one by one, can this be faster than normal method?

Anw, have been using your older version of this, and I have to say, it's pretty much better and easier to manage than the normal way. Thanks for the nice includes, Emmet_.
I've yet to perform some tests, but I suppose that this include could be faster, especially with scripts that use many dialogs.

For example, having a lot of checks under one callback (in this case, OnDialogResponse) clutters the script and makes it look unorganized for most people, and that's more work for the script to process during runtime. It's similar in a way with scripts having many strcmp checks under one callback (OnPlayerCommandText), which is frowned upon by most scripters today.

I wanted to craft a script that had a similar layout to zcmd, not only for better organization, but to provide a more reliable and easier way for scripters to handle dialogs, rather than having them throwing code under one callback. Thanks for the feedback!

Quote:
Originally Posted by [uL]Pottus View Post
The speed is too small to be effectively measurable so it is really irrelevant what is relevant is the ability to organize dialogs in their own functions which is beneficial design wise. I would use y_inline/y_dialogs myself but this method lives up to production quality standards and is good for both beginner and intermediate scripters alike.
I've never heard of y_dialogs before, I should probably check it out.
  Reply With Quote
Old 16/11/2013, 02:40 PM   #15
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,314
Reputation: 1171
Default Re: easyDialog.inc - Dialogs made easier!

Quote:
Originally Posted by Emmet_ View Post
I've yet to perform some tests, but I suppose that this include could be faster, especially with scripts that use many dialogs.

For example, having a lot of checks under one callback (in this case, OnDialogResponse) clutters the script and makes it look unorganized for most people, and that's more work for the script to process during runtime. It's similar in a way with scripts having many strcmp checks under one callback (OnPlayerCommandText), which is frowned upon by most scripters today.

I wanted to craft a script that had a similar layout to zcmd, not only for better organization, but to provide a more reliable and easier way for scripters to handle dialogs, rather than having them throwing code under one callback. Thanks for the feedback!



I've never heard of y_dialogs before, I should probably check it out.
Basically it allows you to embed all your dialog code within a function.

Look here http://forum.sa-mp.com/showthread.php?t=295049
Pottus is offline   Reply With Quote
Old 16/11/2013, 06:04 PM   #16
Twizted
High-roller
 
Twizted's Avatar
 
Join Date: Feb 2011
Posts: 1,671
Reputation: 270
Default Re: easyDialog.inc - Dialogs made easier!

Oh Emmet_, you never let anyone down, do you?
Twizted is offline   Reply With Quote
Old 17/11/2013, 08:55 AM   #17
PT
Godfather
 
PT's Avatar
 
Join Date: Nov 2012
Location: Portugal
Posts: 7,092
Reputation: 736
Default Re: easyDialog.inc - Dialogs made easier!

nice include man

very useful
__________________
"Quem caiu e se levantou honrado era e honrado ficou..."


http://steamcommunity.com/id/pt_player/
PT is online now   Reply With Quote
Old 19/11/2013, 01:40 PM   #18
newbie scripter
Gangsta
 
newbie scripter's Avatar
 
Join Date: Apr 2012
Location: Heaven <3
Posts: 813
Reputation: 34
Default Re: easyDialog.inc - Dialogs made easier!

just a question. Do we need to define the dialogid liek
#define BLAH 111 ??
__________________
SUGGESTION FOR FUTURE SA-MP
Code:
forward SetWeaponRange(weaponid, maxrange); // if weapon is fist and 100 range, it may give a warn or super punch xD
forward SetWeaponRecoil(weapoinid, maxrecoil);
newbie scripter is offline   Reply With Quote
Old 19/11/2013, 02:04 PM   #19
Emmet_
Guest
 
Posts: n/a
Default Re: easyDialog.inc - Dialogs made easier!

Quote:
Originally Posted by newbie scripter View Post
just a question. Do we need to define the dialogid liek
#define BLAH 111 ??
Nope, just this:

Code:
Dialog:MyDialog(playerid, response, listitem, inputtext[])
{
    ...
}

Dialog_Show(playerid, MyDialog, style, caption, info, button1, button2);
  Reply With Quote
Old 19/11/2013, 11:11 PM   #20
Yves
High-roller
 
Yves's Avatar
 
Join Date: Feb 2013
Location: Area 51
Posts: 1,644
Reputation: 122
Default Re: easyDialog.inc - Dialogs made easier!

thanks man
Yves 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
easydialog.inc DaniceMcHarley Scripting Help 6 29/12/2016 12:13 PM
What do you hate to do when making a gamemode, and how can it be made easier? Slice Scripting Help 16 31/07/2012 08:37 AM
Simple way to make tabling easier in dialogs? BlackBank Scripting Help 2 02/09/2011 05:59 PM
Quiz made with dialogs Matej_ Help Archive 9 15/09/2010 07:12 PM


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


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