Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Ghostlady

#21
Ok...so I got this figured out but I still don't understand. See code below.  If I use Mouse.UserModeGraphic with my custom cursor mode it works.  If I use Mouse.ChangeModeGraphic with the sprite # and with the Interact Mode, I lose my arrow. (see commented out lines)

Code: ags
//New cursor logic 
  if (GetLocationType(mouse.x,mouse.y) != eLocationNothing) {
    if(Mouse.Mode!=eModeUseinv)  {
      if (player == cWoman)  Mouse.UseModeGraphic(eModeDapHandU);
//    if (player == cWoman)  Mouse.ChangeModeGraphic(eModeInteract, 485);
      if (player == cMan) Mouse.UseModeGraphic(eModePointer); } }
//    if (player == cMan) Mouse.ChangeModeGraphic(eModeInteract,  16); } }
  else { Mouse.UseDefaultGraphic (); }
  //New cursor logic end

Here are two videos showing working correctly and incorrectly (when I lose the arrow).

Correct:  https://youtu.be/EQFJbFcnn2A

Inccorrect: https://youtu.be/7I21LJAYhQE
#22
1. I went through though the global script and found entries related to the mouse.  At the beginning I disable modes Walkto, Talkto and Lookat. 

2. I am using this to determine either arrow pointer or finger pointer. I am curious what defines Mouse User Default Graphic.

Code: ags
if (GetLocationType(mouse.x,mouse.y) > 0) {
    if(Mouse.Mode!=eModeUseinv) mouse.UseModeGraphic(eModePointer);}
  else {
    Mouse.UseDefaultGraphic(); 

3. There are multiple instances on Guis that the Mouse Mode is being selected.  Here's a few:
Code: ags
These deal with the Inventory box buttons:

function btnInvOK_Click(GUIControl *control, MouseButton button) {
  
    // They pressed the OK button, close the GUI
    gInventory.Visible = false;
    mouse.UseDefaultGraphic();
}
#sectionend btnInvOK_Click  // DO NOT EDIT OR REMOVE THIS LINE


function btnInvSelect_Click(GUIControl *control, MouseButton button) {
  
    // They pressed SELECT, so switch to the Get cursor
    mouse.Mode = eModeInteract;
    // But, override the appearance to look like the arrow
    mouse.UseModeGraphic(eModePointer);
}
#sectionend btnInvSelect_Click  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart btnIconCurInv_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnIconCurInv_Click(GUIControl *control, MouseButton button) {
  
  if (player.ActiveInventory != null)
    mouse.Mode = eModeUseinv;
}
#sectionend btnIconCurInv_Click  // DO NOT EDIT OR REMOVE THIS LINE


This is the icon bar or interface bar
// hide the icon bar and show a GUI
function open_gui(GUI* gui_to_open)
{
 // if (gui_to_open != gInventory)
 // {
 //  lblOverHotspot.Visible = false;
 // }

  gGui3.Visible = false;
  mouse.UseModeGraphic(eModePointer);
  gui_to_open.Visible = true;
}

// hide the GUI and show the icon bar
function close_gui(GUI* gui_to_close)
{
  gui_to_close.Visible = false;
  mouse.UseDefaultGraphic();
  gGui3.Visible = true;
//  lblOverHotspot.Visible = true;
//  gIconbar.Visible = true;
}

4. For movement in the rooms, when I turn left, right, up or down, and the curser finger pointer turns direction, I have created User modes with the different pointing direction graphic. 

Code: ags


Multiple hotspots/entryways
if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hrighthall) {
      mouse.UseModeGraphic(eModeUsermode2); }

if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hlefthall) {
      mouse.UseModeGraphic(eModeUsermode3); }  

if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hdownstairs) {
      mouse.UseModeGraphic(eModeUsermode5); } 



5. To sum this all up, I think #2 above is the "all control of the pointer vs finger and any changes to that scenario will be notated in the global script or the room script.  If this is true, then I don't understand how it works on hotspots and objects based on only GetLocationType.

#23
Update:  I got it working by removing the "was over active area" statements.  On some screens I can see the graphic on the cursor switching images and the buttons on my save/load gui are now unclickable.

Code: ags
//New Area
bool wasOverActiveArea;
void HandleCursor() {
  if (Mouse.Mode == eModeUseinv) return; // do nothing
  bool isOverActiveArea = GetLocationType(mouse.x, mouse.y) != eLocationNothing; // compare to enum!
 // if (isOverActiveArea && !wasOverActiveArea) {
  if (isOverActiveArea)  {
    // mouse just moved over active area
  Mouse.Mode = eModeInteract; }
  else  if (!isOverActiveArea) {
  Mouse.Mode = eModePointer;
  Mouse.ChangeModeGraphic(eModePointer, 22); }
    // mouse just left active area
    //End New Area
}
#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
  
  //New Area
    HandleCursor();
  //End New Area
  
//Old cursor logic 
//  if (GetLocationType(mouse.x,mouse.y) > 0) {
//    if(Mouse.Mode!=eModeUseinv) mouse.UseModeGraphic(eModePointer);}
//  else {
//    Mouse.UseDefaultGraphic(); }
//Old cursor logic end  

//New cursor logic 
  if (GetLocationType(mouse.x,mouse.y) > 0) {
    if ((Mouse.Mode!=eModeUseinv) && (Mouse.Mode == eModeInteract)) {
      if (player == cWoman)  Mouse.ChangeModeGraphic(eModeInteract, 485);
    else  if (player == cMan) Mouse.ChangeModeGraphic(eModeInteract,  16); }
 }
//New cursor logic end
      
#24
Also, I changed the eModeWalkto to Pointer and I get my arrow back but it only shows on the interface dropdown on top of screen.  It seems like the whole screen is being read as an active area.
#25
I must be missing something.  Here's my code.  Basically the eModeWalkto area is not kicking in.  This should be my arrow and it never appears.  The correct color is showing for each character now so that means it is working correctly over an active area of the screen.  I also want to note that in my global script and in my rooms I have this: mouse.DisableMode(eModeWalkto); probably since it is a first person game. What is the mode that defaults for just moving room to room?

Code: ags
bool wasOverActiveArea;
void HandleCursor() {
  if (Mouse.Mode == eModeUseinv) return; // do nothing
  bool isOverActiveArea = GetLocationType(mouse.x, mouse.y) != eLocationNothing; // compare to enum!
  if (isOverActiveArea && !wasOverActiveArea) {
    // mouse just moved over active area
    Mouse.Mode = eModeInteract; 
    if (player == cWoman)  Mouse.ChangeModeGraphic(eModeInteract, 485);
    if (player == cMan) Mouse.ChangeModeGraphic(eModeInteract,  16); }
  else if (!isOverActiveArea && wasOverActiveArea) 
      Mouse.Mode = eModeWalkto;
      Mouse.ChangeModeGraphic(eModeWalkto, 22); {
    // mouse just left active area
  }
}
#26
Hi, I got busy and did not have time to test this.  I am back on it and can't get it to work.
To refresh.  I currently have a blue hand cursor for all the hotspots, objects, etc. and an arrow cursor for when you are just walking around.  I want to be able to switch the graphic for the woman character with a red hand. I want this switch whenever the character interacts with a hotspot or object.  The cursor "pointer" is the man's blue hand and the cursor "DapHandU" is the woman's red hand. Right now with the script changed, I no longer get the arrow, only the hand, which should only be for hotspots etc.

I added a video to show how it is currently working, before the new changes, for better understanding. You will only see the blue hand in this video no matter who the character is.

https://www.youtube.com/watch?v=X9CLy6HqyYw

Here is the code in the script.   

Code: ags
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE

//New Area
bool wasOverActiveArea;
void HandleCursor() {
  if (Mouse.Mode == eModeUseinv) return; // do nothing
  bool isOverActiveArea = GetLocationType(mouse.x, mouse.y) != eLocationNothing; // compare to enum!
    if (isOverActiveArea && !wasOverActiveArea) {
    // mouse just moved over active area
    if (player == cWoman) Mouse.UseModeGraphic(eModeDapHandU); 
    else if (player == cMan) Mouse.UseModeGraphic (eModePointer);
    else  Mouse.UseModeGraphic(eModePointer); 
    else if (!isOverActiveArea && wasOverActiveArea) { Mouse.UseDefaultGraphic();  }
    // mouse just left active area
} }   
  //End New Area

#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
  
  //New Area
     HandleCursor();
  //End New Area
  
//Old cursor logic 
//  if (GetLocationType(mouse.x,mouse.y) > 0) {
//     if(Mouse.Mode!=eModeUseinv) mouse.UseModeGraphic(eModePointer);}
//  else {
 //     Mouse.UseDefaultGraphic(); }
//Old cursor logic end  
#28
I created a new room, added the background, copied in your script.  I grabbed your two sprites, added them to the sprites in the game and put their number in the define area.  When I run the game there are no fireflies.  What am I doing wrong?  I tried commenting out the lines with Game.Camera, still no fireflies.
#29
Can you send me one of your sprites so that I can have my graphic artist take a look at it?
#30
Kris...this is really awesome! I could use this on a separate scene in the swamp.  Its more "magical" with a red fox.  Can I actually do this with this older game?
#31
I am posting the final version in case someone else has an interest in Fireflies.  Thanks everyone for the help.  I love it.

https://youtu.be/TxVn0UbQFfg
#33
The fireflies are now working, very cool.  I slowed the speed down a little.  Tell me what you all think, if I should change anything.

https://www.youtube.com/watch?v=CaYjGR-JUOU
#34
Quote from: Crimson Wizard on Thu 23/01/2025 22:16:04Alright, the situation is clear now. Since your game is 16-bit, then you won't be able to have translucent effects (at least not easily).

Speaking of cutting out firefly frames, perhaps your artist can make these cuts for you? :).
I wanted to try it myself first.  I have a 2023 version of Paint Shop Pro. I need to google a little to figure out how to get the coordinates.  If I can't figure it out I'll definitely ask the artist.  She will do it for me for sure. :)
#35
The fireflies are new assets being created.  The background is from the original game.
The fireflies are shedding light on pieces of the background.  See screenshot above.
The color depth is 16 bit. 
I'm going to go with the fireflies on the background.  Seeing how they look on the background with the light shedding outwards, has a nice look to me.
I just need to figure out how to cut them correctly.
#36
Ah ok, this helps.  Let me see what I can come up with.  Crimsom Wizard to my rescue again.
#37
I originally asked the graphic artist if they could create the fireflies on a transparent background, which I would prefer, and this is how they replied.


I would need to ask if the background has layers.

Based on her explanation, does anyone have any ideas on how to create the fireflies?  Graphics are not in my wheel house so I don't know how to reply and this is why we opted to do the cutting out.

If I opted to do the cutting how do I get them cut on coordinates?  Is this a graphics program with a grid or something like that?

- cut the pieces defined by even coordinates (multiplies of two).
#38
Quote from: Crimson Wizard on Wed 22/01/2025 23:02:21
Quote from: Khris on Wed 22/01/2025 22:42:59One used to use only even coordinates for objects in highres games to avoid precisely the "one pixel off" problem, but newer versions don't use lowres coordinates internally any longer.

Hmm, if this game was upgraded from a very old version of AGS (which it is, I think?), then this setting is kept after upgrade.

You may double check this in General Settings -> Backwards Compatibility -> Use low-resolution coordinates in script.
If it's turned True, that means that you are using old-style coordinate logic, where in high-res games the actual object position is halved. For example, in 640x400 games the object positions are in 320x200 resolution, so you can only have them on even coordinates.

All of the above is true.  Very old game using low-resolution coordinates in script.

What Kris said, "It sounds like if the fireflies are turned on or off during the game, you can see the rectangular area shift slightly because the object isn't aligned with the background exactly." is also true.  For testing purposes, I am turning the objects off and on for the very reason to see if they are on the background correctly.

That being the case, is sounds like the objects have to be cut out a certain way?

This is the background in the game:


This is what I am cutting the firefly objects out of to put on the above background:
 

These are two examples of cutouts I am trying to place onto the background:

#39
Hi, I am back on the fireflies now.  The fireflies were painted onto a background and then I am cutting out the area to make it as an object.  When I lay the object onto the game background, it never aligns correctly.  It is either a byte to high or low or a byte to far left or right.  I did get one out of five to work. I am very confused about this.  Do I have to cut them out a certain way or place them on the background a certain way?

Here is an example of one of the objects, top left outlined in red, that I cannot get to align to the background. If I toggle the object off and on it will shift on the screen.
#40
Quote from: Snarky on Sat 21/12/2024 06:55:39
Quote from: Ghostlady on Fri 20/12/2024 05:33:59They are currently objects with part of the background included.

If they are going to be moving, that will have to be done a different way. Not that that should be difficult, unless the firefly lights interact with the scenery (e.g. throwing shadows).
They won't be moving, just a slow fade in and out, using multiple objects.
SMF spam blocked by CleanTalk