Editor Wishlist/Coordination

Started by Calin Leafshade, Wed 27/10/2010 01:13:54

Previous topic - Next topic

monkey0506

Quote from: Ryan Timothy on Thu 14/07/2011 01:46:25Global script:
function Whatever(int A, int B) { }

Then while typing in the editor pane for the OnClick function, as you type: Whatever   AGS pops up the: function Whatever(int A, int B)
and you can pass whatever variable or value into those fields.

In addition to what Khris said, which I absolutely agree with, part of the problem is where you say "you can pass whatever variable...". Unless you're just explicitly calling the function for some other reason than what the event handler itself has been created for, you don't pass anything into the event handler, so how would you specify what those values were? Any values being passed in would have to be either static or linked directly to a global variable, and in the latter case the entire feature has just negated its own purpose.

So in the case of static values, I don't see any difference between setting up in the editor, Button 1 Properties, OnClick Handler Parameter 1: 10, versus:

Code: ags
function btnWhatever(GUIControl *control, MouseButton button)
{
  int param;
  if (control == btnWhatever1) param = 10;
}


So no matter how you look at it in this case, I don't see how you're accomplishing anything you couldn't already do. One extra function call that establishes the values as opposed to entirely rewriting the way AGS handles event handlers...doesn't seem worth the cost to effect the change to me.

Edit: Rick posted before me.

Rick, don't get me wrong, I understand why function pointers are useful, and particularly if we could utilize them in a fashion similar to C#'s delegates and events that that would be great for module writers. However, that's not what Ryan's asking about. Ryan is specifically referring to the linkage of the built-in events.

RickJ

@monkey:  "Ryan is specifically referring to the linkage of the built-in events."  Perhaps I'm reading more into his comments that I should.  I was thinking he was just using built-in events to illustrate his idea, so I thought I'd help the discussion along.  If we are only talking about built-in events I agree with you.

Btw, is it possible for built-in event handlers to reside inside modules?

Ryan Timothy B

#142
I understand your argument and I also agree with it not being overly useful considering the time it would take to get it to work. I just had always felt it was something that AGS was lacking; especially when I first started using it. It was just a suggestion no more than that.

In the beginning of my AGS 'learnings', I had twenty-something GUI buttons that all did their own thing. But using the same function to process the action, just like Khris' example of the keypad. I tried to pass the OnEvent to the single global function with the required parameters to find out AGS doesn't support the passing of variables/static values.

Then I had to change all my existing buttons to be in numerical order, since I hadn't created the GUI fully knowing how many buttons I was going to need. Either that or create the 20 default OnClick functions for the buttons having them point to the single function, or just pointing the OnClick directly to the single function with Else If's checking which button it is.

Like I said, it was just a suggestion and I agree with your argument. I didn't mean for this to take an entire page to get my point across, so we can just leave this suggestion as is. I was basically just hoping "If it was possible to do easily, then why not?", but I doubt that is the case.

monkey0506

#143
Well it's not just a matter of "is it possible", it's a matter of the reasonability of the suggestion.

For what you're wanting to do, the editor would have to be modified to allow event handlers to specify how many and what type the parameters should be, in addition to the actual values, which as I said would have to be either static or linked to global variables. So now we need some huge schema editor similar to the (Custom) Properties Schema Editor so that you can define how you would like AGS to handle each and every (type of) event handler. Even if undefined values could revert to the AGS default parameter list, this would still be a rather large feat in and of itself. From there the editor would have to read said schema every time the events pane is drawn so that it can create a subsection for every event handler in the events pane to allow you to specify the values.

The engine would have to be modified to allow the event handlers to have a variable argument list at run-time, otherwise you'd have to build a custom engine every time you compiled the game. In addition to that, the actual run-time calls to the event handlers would have to extrapolate the parameters that had been passed through the variable argument list, based on the data entered in the editor at design-time. Once the parameters had been extracted, then AGS would be able to actually place the call to the event handler itself.

These are not insignificant changes, and your suggestion was to make these changes so that you could avoid having to include a few if-else if statements in your code. I honestly don't understand the aversion to having to type out these if-blocks. If you did it properly you wouldn't have to duplicate any code, would have only one event handler for each of the controls (or other items) that needed the additional parsing, and quite realistically it would probably take less time to type out the if-block than it would to go through every one of these controls and specifying the static values in each control's respective Properties pane. I honestly believe that your design-time work flow would be more efficient with the event handling the way it already is, and an understanding of such, than the scenario you've described.

I'm not trying to be rude or bash your suggestion. As you said, it was just a suggestion. All I'm trying to do is explain why, in my opinion, your suggestion is not only worthwhile for implementation (due to the sheer amount of changes that would have to be made when weighed against the "benefit"), but would actually have the reverse effect of the intended one.

Joseph DiPerla

I would like to request a type of point plotting in the room editor. I know I can draw free-hand or use lines. But point plotting takes away the stress of trying to connect the lines or by have to hold a steady line. Basically, you click on one area of the screen and then on another and a line is drawn from point a to b and you can keep connecting the dots until you press Escape or some other release key.

Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

monkey0506

I could actually see the usefulness of that, but I'd prefer it more like in Photoshop, where you can use the "pencil" tool normally to draw individual points or freehand, but if you draw a single point, then hold down shift and the select another point, it will draw a straight line between those two points.

Joseph DiPerla

That works too as long as I can continuously connect points by holding shift.
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

monkey0506

That's how it works in Photoshop! :D And I actually find it more useful than the line tool unless I don't know where I need the end-point to be (for the reasons you mentioned).

InCreator

#148
I'd love to have current tiled sprite import removed entirely  -
because it's basically useless, the time you pixel hunt to get everything right takes actually more time than saving frames separately and -- it would be time better spent! -
and replaced with something much easier to use, like the one Game Maker uses (perfect, high level of customization) or a simply smart one like filmstrip import in Gif Movie Gear -- you only tell how much frames strip has and it chops them down automatically evenly to get required number of frames

Tilesheets - while rarely used by AGSers - are very powerful way to manage sprite graphics and the unpopularity is very clearly tied to the fact that AGS isn't making it's usage any easier.
Would you like 800 files for 100 animations or only one? What if you decide to add a detail onto characters clothing?

While this can be reworked right now using GIF importing and other tricks, AGS should be self-sufficient.

I imagine it's an eveningful of coding for a good coder. If I had skills, I'd implement it myself.

RickJ

Second what InCreator says.  I gave up on tiled sprites a long time ago.   

Calin Leafshade

Spritesheets are only really useful for memory conservation in-engine. Since AGS splits them up anyway they lose all their benefit. individual images or gifs are a far better way of importing.

InCreator

#151
On engine level, yes.
But for actual image editing, sprite sheets give a good overview, organization and ability to adjust (such as copypaste a detail, make slight change in sprite so all animations get it instantly (say, you want to color red shirt green. Have fun with going over every file!), etc etc) on the fly, and that's very much overlooked. If you find no use to sheets, try first and thank me later.
Also, I fail to see how importing file by file or GIFs is any way better than importing areas of same sheet? With as shitty tiled import is right now, true. But with any other software that does this right, it's way another ballgame.

Also there's quite a difference between 10 characters and few opening doors for MAGS game and full featured project with enormous amount of animations and sprites to manage. This is where TSI is required.

LUniqueDan

Room folders. Please. Room folders.
"I've... seen things you people wouldn't believe. Destroyed pigeon nests on the roof of the toolshed. I watched dead mice glitter in the dark, near the rain gutter trap.
All those moments... will be lost... in time, like tears... in... rain."

Dualnames

Quote from: LUniqueDan on Sun 17/07/2011 10:06:21
Room folders. Please. Room folders.

Seconded!! I've never been lucky enough to make a game that didn't kind of need this. It's really nice to have it for views and sprites, and I believe it would be useful for rooms too.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Shane 'ProgZmax' Stevens

#154
If I had some time I'd like to eliminate objects from rooms and just turn characters into an entity class that serves both needs.  This would mean adding another tier to the treeview on the right (below characters) for the 'object' store, as well as adding folder support to both.  That way, if you still wanted to recognize objects by the room they initially appear in you could place them in a folder called 'Room 1'.  For players, folders would be a good way of organizing by type to reduce clutter.

Unfortunately, I'm busy with so much stuff right now... But maybe someone else might want to take on unifying objects and characters into one class so objects no longer have the silly limitations imposed on them (inability to set frame, limited number of objects per room, objects can't transition rooms, etc).  There's no reason why they shouldn't just share one class and all the benefits thereof, and many people circumvent objects entirely now with characters, making the logical step just to strip them from being tied to rooms and allow the user to make as many as they want, wherever they want.

Joseph DiPerla

Quote from: Joseph DiPerla on Fri 15/07/2011 17:23:48
I would like to request a type of point plotting in the room editor. I know I can draw free-hand or use lines. But point plotting takes away the stress of trying to connect the lines or by have to hold a steady line. Basically, you click on one area of the screen and then on another and a line is drawn from point a to b and you can keep connecting the dots until you press Escape or some other release key.



I haven't looked at the editor source and I still need some more practice with my C#, but for my suggestion, I figured I would point out this code I found at these sites which might do what I want. Of course, a little tweaking will be necessary. But if someone has the time to include this feature into the AGS Editor, you would be making me very happy:

http://www.java2s.com/Code/CSharp/2D-Graphics/Drawpath.htm

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawpath.aspx

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawpath(v=vs.71).aspx
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

SMF spam blocked by CleanTalk