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

#1
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 ?
#2
Quote from: CaptainD on Fri 28/07/2023 20:18:52You could use a character, but you could also use Surface.DisplayString. If you did that you'd have to (for instance) draw a background colour rectangle over it once you wanted the text to disappear though.

Another possibility is using a GUI text label, which can be redefined within the room code.


Could you be more specific about the GUI version  please ? I'm still learning the hang of it (ags). While I tried to use a normal character text, I cannot seem to find where can I modify how long it can appear on screen(it flashes just for 1 second) or how to actually change its size(to be bigger)
#3
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. :(
#4
Nevermind, after a re=run it seems like I was not paying attention and actually they did not stop. thanks for your answer, I think this is solved.
#5
Yes you are right !

Thank you so much for the reply.
Regardless, I managed to do this myself, by using 2 kind of GUI's , one that is transparent 50% and one that is fully invisible, just like this :

Code: ags

function room_Load() {
oSky1.SetView(VSKY);
oSky1.Animate(0, 20, eRepeat,  eNoBlock);
}

function room_AfterFadeIn() {
  Wait(20);
  gBlack1.Visible = false;
  Wait(20);
  gBlack2.Visible =false;
}



The problem that I'm encountering now is while this all happens, the 'animation' that I set up in my background (via the vSky stuff) pauses untill the fade out effect is finished. Is there a workaround against this ?
#6
Hey ! I managed to make my own FADE IN
using a guy with this code
Code: ags
function room_Load() {
gBlack1.Visible = true;
FadeOut(64);
oSky1.SetView(VSKY);
oSky1.Animate(0, 20, eRepeat,  eNoBlock);
}

function room_AfterFadeIn() {
  FadeOut(64);
  gBlack1.Visible = false;
  Wait(1);
  FadeIn(1);
}







- the vsky should be ignored since it does not have anything to do with my problem.
The thing is, how can I make it so that the 'fade out' effect is not as fluid ? I want to make it in a way so that it shows 2 levels of transparency (half, and completely transparent) successible, like on those old 8-bit games, the 'transition' has very low fps. Anyone can help me with that ?
#7
Also I hope my broken english at least allowed me to explain what I'm trying to achieve =(
#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