Author Topic: Feature suggestion: Add ability to mak coordinates using the visual editor  (Read 572 times)

artium

    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
If I want a character to walk to a specific location in the room using script, I need to use the mouse pointer to find the coordinates, then I can write a script command similar to:

Code: Adventure Game Studio
  1. cEgo.Walk(14, 22);

or better:

Code: Adventure Game Studio
  1. int ladderX = 14;
  2. int ladderY = 22;
  3. cEgo.Walk(ladderX, ladderY);

To demonstrate that this is not just my noobish ignorance of a better way, here is an example from Dave Gilbert's Unavowed devstream #4 - Doors doors doors doors doors:



(the culprit is "player.placeAt(382,294);" )

I think that it would be nice if one could mark a coordinate on the screen, give it a name and use the name in script, similar to how regions, walk able areas etc. work.



This will be more intuitive, more maintainable and possibly prevent some mistakes.

Code: Adventure Game Studio
  1. cEgo.Walk(coordLadder.x, coordLadder.y);

or even

Code: Adventure Game Studio
  1. cEgo.Walk(coordLadder);
« Last Edit: 19 Dec 2017, 19:29 by artium »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
To demonstrate that this is not just my noobish ignorance of a better way, here is an example from Dave Gilbert's Unavowed devstream #4 - Doors doors doors doors doors

Dave Gilbert is a n00b, it was noticed on several occasions that he is not aware of some features from AGS that make things easier :D

Seriously, though, this is a valid feature suggestion, and frankly pretty old one. I may be mistaken, but I think someone even did an Editor plugin for Points. Or maybe that was special Editor version... I cannot find it on forums though.


In the meanwhile, ways to make life tad simplier:
1. Middle mouse button click in the room editor brings context menu with "Copy coordinates" command, which copies coordinates in "X, Y" format, ready to be pasted into Walk function.
2. Expanding the "int ladderX, ladderY" example, since AGS 3.4.0 it is possible to write managed Point class, declare your own Point objects in room script and use these. The remaining inconvenience will be that you won't be able to see and manipulate them in room editor, but at least you will have named points.

Dummy example:
Code: Adventure Game Studio
  1. // in the script module:
  2. managed struct Point
  3. {
  4.   int x;
  5.   int y;
  6. };
  7.  
  8. // in room script
  9. Point *WhereToGo;
  10.  
  11. function Room_Load()
  12. {
  13.     WhereToGo = new Point;
  14.     WhereToGo.x = ...;
  15.     WhereToGo.y = ...;
  16. }
  17.  
  18. function SomeInteraction()
  19. {
  20.     player.Walk(WhereToGo.x, WhereToGo.y);
  21. }
  22.  
« Last Edit: 19 Dec 2017, 20:28 by Crimson Wizard »

I like this idea, please don't destroy the points if the background is replaced by one that is 2 pixels bigger.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
please don't destroy the points if the background is replaced by one that is 2 pixels bigger.
This sounds like a separate suggestion for hotspots and walkable areas :).

tzachs

  • AGS Baker
  • Mittens Vassal
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
    • tzachs worked on a game that was nominated for an AGS Award!