SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 15/11/2013, 07:21 PM   #11
StuartD
High-roller
 
StuartD's Avatar
 
Join Date: Jul 2012
Location: United Kingdom
Posts: 1,104
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, 01: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, 01:45 AM   #13
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,418
Reputation: 1224
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, 12: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, 01:40 PM   #15
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,418
Reputation: 1224
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, 05:04 PM   #16
Twizted
Banned
 
Join Date: Feb 2011
Posts: 1,673
Reputation: 279
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, 07:55 AM   #17
PT
Godfather
 
PT's Avatar
 
Join Date: Nov 2012
Location: Portugal
Posts: 7,179
Reputation: 775
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 offline   Reply With Quote
Old 19/11/2013, 12:40 PM   #18
newbie scripter
Gangsta
 
newbie scripter's Avatar
 
Join Date: Apr 2012
Location: Heaven <3
Posts: 811
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, 01: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, 10:11 PM   #20
Yves
High-roller
 
Yves's Avatar
 
Join Date: Feb 2013
Location: Area 51
Posts: 1,633
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 11:13 AM
What do you hate to do when making a gamemode, and how can it be made easier? Slice Scripting Help 16 31/07/2012 07:37 AM
Simple way to make tabling easier in dialogs? BlackBank Scripting Help 2 02/09/2011 04:59 PM
Quiz made with dialogs Matej_ Help Archive 9 15/09/2010 06:12 PM


All times are GMT. The time now is 07:38 PM.


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