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 - JackAnimated

#1
I want the mouse cursor to change whenever over any object. Here is the code I have, which lives in Global Script in rep_exec:

Code: ags
 Object*o = null;
    
    o = Object.GetAtScreenXY(mouse.x, mouse.y);
    if (o != null)
    {  
    Mouse.UseModeGraphic(2); 
    } 


Needless to say, it's currently not working.

Thanks.
#2
Thanks for the help and different ideas everyone!

Quote from: Khris on Thu 07/02/2019 15:29:53
Quote from: JackAnimated on Thu 07/02/2019 14:12:48
ok thanks. How would one write a script that changes a cursor when hovering over an object? I've done it for hotspots but seems not be more tricky for objects.
Again, it depends. Mostly on whether you need this as global behavior for many objects game-wide, or just for a single object.

If you want a cursor change for several, specific objects (say the cursor is supposed to turn into an exit sign while hovering over door objects), it's best to create a custom property and write code accordingly. For a single object you just need a bunch of lines in Room_RepExec.

This is what I have in my global script, unfortunately to zero effect:

Code: ags
 Object*o = Object.GetAtScreenXY(mouse.x, mouse.y);
    if (o == object[1])
    {  
    Mouse.UseModeGraphic(2); 
    } 
#3
ok thanks. How would one write a script that changes a cursor when hovering over an object? I've done it for hotspots but seems not be more tricky for objects.
#4
Ok, that works.

It's a little fussy if you have already scripted it, then add the event, it won't like it.
#5
It appears that room_load is not working. I tried with function room_AfterFadeIn() and it worked fine.
#6
So the object blocks clicking on the hotspot but does not stop action set when the cursor hovers over the hotspot.

My solution is to disable the hotspot when at a certain "chapter act" of my story which coincides with the object being in place. So chapter_act is a global variable.

However my code in the room does not seem to effect the ability of the hotspot:

Code: ags
function room_Load()
{
  if (chapter_act == 1)
  {
  hHotspot3.Enabled = false;
  }
}


What's wrong here?
#8
So if an object of a door was over a doorway with a hotspot, when clicking on the object the hotspot would not register a click?
#9
Quote from: Slasher on Thu 07/02/2019 08:09:02
Yes, you can enable/disable a hotspot...


Thank you. Regarding my game setup that its first person and I will be painting full backgrounds including interactable objects within the same painting, are hotspots the best way to go for to make interactable areas for them also?
#10
Ok interesting, so the situation in my game is:

The game is in first person perspective and generally I have hotspot over open doors, which when clicked upon take the player to the next room. If I wanted one of these locked or closed, is it possible to have a hotspot be disabled and then activated later after an event or item pickup for example?
#11
In my project there are Doors in rooms, some are locked but become unlocked later, and visa versa.

What is the best why of setting this up?

Hotspots with conditions, regions with conditions, objects or even completely new room copies with different hotspots?

I'm not sure the best way to go forward.

What is your preference and why please?

Thanks.
#12
That's what I get for searching decade old posts.

Thanks for the correction. It wasn't the only out of date term I was using. Here's the working solution for reference:

Code: ags
Hotspot*h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
if (h == hotspot[1]) {  
Mouse.UseModeGraphic(10);
} else {
Mouse.UseDefaultGraphic();
}
#13
Next issue:

Getting an "undefined symbol "GetHotspotAt"" error when I put this code in the Global Script:

Code: ags
if (GetHotspotAt(mouse.x,mouse.y)==1) {
SetMouseCursor(10);
} else {
SetDefaultCursor();
}



#14
Quote from: Crimson Wizard on Wed 06/02/2019 14:57:37
Quote from: JackAnimated on Wed 06/02/2019 14:22:58
Ah cool. So I'm right at the start of the development of my project. Is this version stable to develop the whole project with?

Maybe  :=

Well, its in active development and we try fix reported bugs fast.

ok cool. think I'll risk it ;)
#15
Quote from: Crimson Wizard on Wed 06/02/2019 13:49:43
Quote from: JackAnimated on Wed 06/02/2019 13:26:12
I'm making a game with 1920 x 1080 resolution. Its displaying full size in the room preview window.
Is there a way I can preview it at 75% or 50% for easier viewing?

Zoom out was not supported earlier unfortunately (games of that high resolution are not very commonly made with AGS), but as Khris mentioned this is implemented in new wip version of AGS (3.5.0), as well as support for larger resource files and number of assets.


Ah cool. So I'm right at the start of the development of my project. Is this version stable to develop the whole project with?
#16
Next dumb question:

I'm making a game with 1920 x 1080 resolution. Its displaying full size in the room preview window.
Is there a way I can preview it at 75% or 50% for easier viewing?
#17
Great! It was the rebuilding shinanigans. Worked a treat. I'll remember to do that.
#18
Sorry guys its been years.
I'm back and I've forgotten everything so please have patience while I ask a bunch of very dumb questions.

Firstly:

I've uploaded new sprites for my cursors into AGS. I've gone to the cursor node and set all of them to the no# of my new sprite image. I build and run my game and its still using the default cursor sprite. Please help.

Massive thanks.

Jack
SMF spam blocked by CleanTalk