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

Topics - Phonoitypal

#1
Hi, its me again, with a problem that I really have no clue(I remained totally clueless) how to fix !
 For some reason in my game any click registers as x2 click. For example, If I want to trigger an animation via hotspot click, even if I assign the view as eOnce, it behaves like I click it 2 times, animating it TWICE at once. The same if I had - say - a keypad puzzle, it registers the clicks as x2 times. I have a script that changes the cursor while hovering over objects, but It does not change the 'cursor mode', - but the graphics of the cursor...I dont know why that is happening D:
I think I need to post all  the script from my on mouse click from the global script and anything related to the mouse in general,


I really cant see why this happens 😦
for example while triggering GUI's, it only registers 'one' click, not x2 as it does on anything related to adding characters to strings or triggering animations








 
Code: ags


// called when a mouse button is clicked
function on_mouse_click(MouseButton button)
{
 if (button == eMouseLeft) {
    // left-clicking nothing with active inv item
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing && player.ActiveInventory != null) {
      player.ActiveInventory = null;
      Mouse.Mode = eModeInteract;
    }
    else Room.ProcessClick(mouse.x, mouse.y, Mouse.Mode);
  }





 (its a script that makes you able to click away with an inventory item and make it dissapear, returning the 'normal' cursor) 


And the one that changes the mouse graphic while hovering over hotspots/objects
Code: ags
function repeatedly_execute()
{
  if (player.ActiveInventory ==null){
    if (GetLocationType(mouse.x, mouse.y) != eLocationNothing) {
        // Set the variable to true when the mouse is over a hotspot
        if (!isOverHotspot) {
            // Execute global script only when entering a hotspot
            Mouse.ChangeModeGraphic(mouse.Mode, 24);
            aMousetape.Play();
        }
        isOverHotspot = true;
    } else {
        // If the mouse is not over a hotspot, execute the global script
        if (!isOverHotspot) {
            Mouse.ChangeModeGraphic(mouse.Mode, 22);
        }
        // Reset the variable
        isOverHotspot = false;
    }
}
}
I also did some weird stuff to be able to add my own 'cursor graphic' on some very specific hotspots(thus disabling the always execute thing)

Code: ags
  
function on_mouse_over_hotspot()
{
    // Disable global script when over a hotspot
    isOverHotspot = true;
}

// Handle mouse leave hotspot event
function on_mouse_leave_hotspot()
{
    // Enable global script when leaving a hotspot
    isOverHotspot = false;
}








 >:(  >:(  >:(  >:(  >:(  Im sure its because of the way I implemented these scripts ! (For context, the objects/hotspots that trigger certain events that play x2  times are linked only once. I tried to change the 'any click' from 'interact' and whatnot, and its still the same behaviour)




#2
Hi !
I'm trying to make a keypad puzzle.
Basically what I've done first, is create a global variable called 'player sequence' with its initial value, as nothing

Then, I made the following code
Code: ags
function room_Load() {
   playerSequence = "";
}

function CheckPassword() {
if (playerSequence.EndsWith("680")) { 
Display("Password Detection works debug thing");
}
else { 
Display("wrong password debug thing!");
playerSequence = "";
}
}





function oObject6_AnyClick()
{
playerSequence = playerSequence.AppendChar('6');
aAkeypad.Play();
}

function oObject1_AnyClick()
{
aAkeypad.Play();
CheckPassword();
}

function oObject3_AnyClick()
{
playerSequence = playerSequence.AppendChar('8');
aAkeypad.Play();
}

function oObject4_AnyClick()
{
playerSequence = playerSequence.AppendChar('0');
aAkeypad.Play();
}



So, each button would add a character to the playersequence string.
The button that has just 'check password' is a button resembling the enter button.

Now, the weird behaviour that im encountering, is for example. if I would add 'string ends with' a repeating number, for example 888, or 000, the code will work without problems.

But : If I add different numbers, such as in my case, lets say, 680, regardless if I press 6 8 0 in order, it still will give the display/debug message as the password would be incorrect !
Im so confused, could anyone give me some insight regarding this matter?


#3
Hi !
I have a very noobish problem.
I want to make it so that after the cursor changes based on the item sprite, if you click 'away' , or on a hotspot that has no correlation with the "useinv"function, to make the cursor go back to normal. When I use the inventory item(along with its cursor) to a designated hotspot that that useinv function, the cursor goes back to normal(as expected), but If i dont use the item anywhere, its impossible to 'deselect' the item along with its cursor.

Sadly, so far  I failed in my attempts to do this. Can anyone help me ?


For context, I have the following script that changes my cursor based on hovering over hotspots/objects etc. I think maybe it will give more context

Code: ags
function repeatedly_execute()
{
  if (player.ActiveInventory ==null){
    if (GetLocationType(mouse.x, mouse.y) != eLocationNothing) {
        // Set the variable to true when the mouse is over a hotspot
        if (!isOverHotspot) {
            // Execute global script only when entering a hotspot
            Mouse.ChangeModeGraphic(mouse.Mode, 24);
            aMmove.Play();
        }
        isOverHotspot = true;
    } else {
        // If the mouse is not over a hotspot, execute the global script
        if (!isOverHotspot) {
            Mouse.ChangeModeGraphic(mouse.Mode, 22);
        }
        // Reset the variable
        isOverHotspot = false;
    }
}
}



BUT
 so far, I tried to do the following regarding what I tried to achieve :


Code: ags
if (player.ActiveInventory != null) //An inventory item is selected
{
  player.ActiveInventory = null;
  mouse.Mode = eModeInteract;
}

But here the problem is that it completely annihilates and ignores the useinv function, it just changes the mouse cursor after I click on an inventory and CLICK anywhere, and prevents the item's usage. I checked other threads but none of the solutions worked :( :~(  :~(
#4
Hi !
I'm working on an atmospheric/surreal first person point and click game.
It will have some interesting mechanics, inspired by my dreams.
You are in an outwordly place - an nightmarish world - at the edge of the world, literally.
The game will have multiple endings and depends on what you will chose during the playthrough.
I just wanted to show my creation, and any kind of feedback is VERY welcome !
I released a short demo here ! I would gladly appreciate your feedback since im a begginer and i'm really open to criticism of any kind !

Demo :  https://phonoitypal.itch.io/phonoi
Some of the images are placeholders and will not look that 'unpolished' when the game will be finished !





And some actual gameplay:(old)
#5
Hi, I have some problems regarding the usage of inventory items.

I'm making a first person game, and I created my custom inventory.
The items work just fine(they appear on the gui), the gui is set alright with its own window, item appears where its supposed to.
Also, room scripts regarding  "if (player.HasInventory(iItemName))" work !

The problem appears when trying to use the inventory ITEM on a hotspot that has the property
"player.ActiveInventory==iItemName)".

The item of the cursor changes as the one of the item, but it doesent seem to work.


I have the following global script that I think it may cause the problem


Code: ags
// called on every game cycle, except when the game is blocked
function repeatedly_execute()
{
  if (player.ActiveInventory ==null){
    if (GetLocationType(mouse.x, mouse.y) != eLocationNothing) {
        // Set the variable to true when the mouse is over a hotspot
        if (!isOverHotspot) {
            // Execute global script only when entering a hotspot
            Mouse.ChangeModeGraphic(mouse.Mode, 24);
        }
        isOverHotspot = true;
    } else {
        // If the mouse is not over a hotspot, execute the global script
        if (!isOverHotspot) {
            Mouse.ChangeModeGraphic(mouse.Mode, 22);
        }
        // Reset the variable
        isOverHotspot = false;
    }
}
}

Basically what this script does is to check if im hovering over an object to change the cursor, and re-change it back to 'original' while on 'nothing'. Also the first line is made in that way so it will 'stop executing' while having an inventory item as a cursor.
I also added that stuff to make it 'not execute' while on a specific hotspot (to put back arrows etc in the room)

Furthermore, to make the ItemCursor dissapear while clicking on something(for example, clicking away of any hotspot or on areas that are not designated for its use with the item)I have the following script :

Code: ags
function on_mouse_click(MouseButton button)
{
  if (player.ActiveInventory != null) //An inventory item is selected
{
  player.ActiveInventory = null;
  mouse.Mode = eModeInteract;
}


I don't know why the item would not work while using it on the designated hotspot with the useinv proprety.
I'm sure it's because of some way that I probably messed up the mouse cursor somehow ?

Also, tried to change the above code "mouse.Mode = eModeInteract;" with eModeUseInv but it does not work ! :(

Anyone could help me solve this issue ? I feel so confused !
#6
It's me, again, bothering you with a silly question.
I'm making a first person game, and took the advice(which is actually very useful) from another post that one should use only 1 type of cursor.
I have the following code :

Code: ags

function room_AfterFadeIn() {
  Wait(30);
  gBlack1.Visible = false;
  Wait(30);
  gBlack2.Visible =false;
  mouse.UseModeGraphic(eModeInteract);
  Mouse.Mode = eModeInteract;
  mouse.Visible = true;
}



Because I want the cursor to appear after the fade-in. so far so good !

I added the following code to the hotspot, advice taken from some forum post


Code: ags
function hHotspot1_MouseMove()
{
mouse.SaveCursorUntilItLeaves();  
mouse.ChangeModeGraphic(mouse.Mode, 24);
}


The thing is, after moving back the cursor from the hotspot, the same 'changed' graphic persists, not reverting back to its original graphic that I selected(and that it was present before hovering to the hotspot). In the documentation it is written to put the 'savecursoruntillitleaves' think BEFORE the changing - which I did - to actually prevent that from happening. I tried to add the

 "  Mouse.Mode = eModeInteract;
mouse.UseModeGraphic(eModeInteract); 

"
into the global script, but that does not seem to work. also, others 'update' functions relating to the mouse when put into the "global script" again do not work =(.

Can you please provide a more correct code or point me out in the direction of what I'm doing wrong, please ?
#7
Hello again!
I've encountered the following difficulty:
While working on a first person game(using a blank template for the sake of learning the engine as a whole), I want to be able to trigger text that will be somewhere at the bottom of the screen. The problem is, while I can do that using the Display Text function, the game pauses, freezing all the animations that happen(and are necessary) in the background.
My question is : how can I actually print text on to the screen, so that it may be at the bottom of the screen, thus not 'pausing'the game? I thought about making an invisible character that would be positioned somewhere in the mid-bottom, but I am sure there is another way that is more efficent. Thanks in advance and I hope that someone can help me. :(
#8
Hello !
This is my second day of using AGS.
I'm working on some game, so far - so good, I'm reading the documentation and I got a 'hang of it' - managed to do my first animation in the engine etc.
But I encountered a problem, which I think, in it's essence, might be simple, but I honestly lack the understanding as how to do it.

The idea : I want to make my own 'fade in' as in an object that is completely black, that decreases its transparancey over time so that it reaches 100(invisible); The question that I'm about to ask has to do with my stupid way of implementing it so that it does not work. Anyways, this question will also help me in the future regarding object transition of transparency and so on. I think I got lost a bit in the detail.

THE PROBLEM :
Whenever I'm trying to use the provided documentation regarding transparency
Code: ags
int trans = object[0].Transparency;
while (trans < 100) {
    trans++;
    object[0].Transparency = trans;
    Wait(1);
}

I get the error that after the "= of trans" the 'engine' expects an integer value.

What I did, so far, to test, was this

Code: ags
function room_Load() {
oBlack1.Transparency = 0; //Visible
}
if I try to put it in the room_Load stuff, it would not work, so I followed this example provided here:
Code: ags
function room_Load() {
  object[?].Transparency = 100; // Make full screen Object invisible.
}
followed by

Code: ags

// BEGIN FADING IN FULL SCREEN OBJECT SCRIPT.
        //-------------------------------------------
        int trans = object[?].Transparency; // Fade in the full screen Object until it is visible. 
        while (trans > 0) {
        trans--;
        object[?].Transparency = trans;
        Wait(1);
        }
        // END OF FADE IN SCRIPT.
        //-----------------------




Following this example step by step, replacing the object[?] - with my case, oBlack1 etc, does not work and always gives an unexpected 'while' or the engine crashes.
What am I doing wrong ? Could someone shed light as what I am missing ?

Thanks in advance and I really hope im not wasting your time !
SMF spam blocked by CleanTalk