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

#21
I thought to myself 'yes'! That's it! I could probably use Resetroom to do this! 'psuedo hotel room trick' = one room but stores the room changes in global variables (light,switches,etc). If i store the values in global variables those are obviously outside of the room.

However once leaving the room calling
Code: ags
 ResetRoom(number);

It takes away the added global values, since it was added in the room. If it was a room int value i would get it. Is that delibrate logic? It would make forexample "psuedo hotelroom" setups easier. If the global values would not get affected. I've solved it with a dumb solution atm using bools and a int for each room, which works since i'm no legit coder.

But it's more of a job i think. Then if i could have just went *add global variable int for each psuedo room* and ++; each time a button or a lamp or whatever is lit in that room and ofc --; when turned off then re-entering the room and it will check for if it was that room i was in before or another room and it will setup itself accordingly with that one int (if i'm thinking correctly). I understand ofc there are probably  'programmer ways' to do this properly

Code examples are very much welcomed as always! Lots of objects and hotspots to click around in the room :-D

#22
So i'm doing this general function for a Gui Popup "controller connected" or "instructions" or "Achievements" sign in the corner. I've noticed some games, no big titles named. They have controller support, however it never says "controller is connected" and it was confusing at first, eventually i realised "omg it's got controller support. That's why the mouse is acting all weird!".

So i'd figured in my game i want a popup for when it's connected, or if it accidently get's disconnected, just in case that happens! Everything is fine apart from i can't manage to get it to stay on screen for some seconds without having it blocking the game. Optimal would be to start the timer after i've pushed the mousebutton or random gamepad button.

When i try tween it with a Timer, that doesn't work for me. It complains about it being a blocking action since i'm obviously using repeatedly execute to check for when the timer has expired. What do i do?

This is the code i have so far..

Code: ags
function Which_Controller_Is_Connected_Gui()

{
    gamepad = Controller.Open(0);
    String inputName = gamepad.GetName();
  
    if (inputName == "PS4 Controller")
  
  
    if (gamepad.Plugged()==true)

{

    if (gPlaystation_4.Visible==true)
{
    if (!gamepad.PressAnyKey() || mouse.IsButtonDown(eMouseLeft))
{
  
  Wait(25); //I don't like. Blocks the player. But i also don't want it to get of the screen immediately
            //I want the player to be able to see it first "Oh, hey a controller or hey a information box"!
            //however if you click the mouse button or the gamepad it flys away fast.
            //so a timer would be neccessary
  aSwoosh_Items.Play();
  gPlaystation_4.TweenPosition(0.7, 220, 250,eNoBlockTween); //I want this to delay or wait a second or two
  gPlaystation_4.Visible=false;
  gPlaystation_4.Transparency=100;
  
} 
}
  
  else if (gamepad.Plugged()==false)

{
  gPlaystation_4.SetPosition(221, 161); //Just in case it's unplugged by mistake it get's noticed..
  gPlaystation_4.Transparency=0; 
  gPlaystation_4.Visible=true;
}
  
}
}



#23
What i mean is when the speech file is "silent" or almost silent since most people probably aren't obsessed audiofreaks like me. Is there such a thing? I want a 'psuedo lipsync' module, because it would look much better for pixelart. The goal is to have it check for when the speech file has these slight pauses between the sentences. That it immediately then goes to a closed mouth frame via repeately execute, and then after that the speech restarts itself once there's "hearable speech" in the audio file again.

I know AGS recognise's that a audio file is playing and you can stop, resume, etc, but i can't seem to find anything other then that in the manual. Like "IsAudioSilent" sounds stupid, but you get the point! (laugh)

#24
Edit: Solved it myself, solution at the bottom
Abstauber tried to explain to me long ago in a DM. I didn't get it to work then and not now either! (laugh)
Alltho i'm now trying with an object instead of a hotspot that he explained, but i think it should work in theory when i look at his code ???

This is the code i have inside the VerbsGui.asc

Code: ags
static void Verbs::VariableExtensions() 
{

// define here, which things will use a variable extension (>v)
  // by default, it's only used for doors.
  int r = player.Room;
  Object*oo = Object.GetAtScreenXY(mouse.x, mouse.y);
  int o=0;
  if (oo != null) o = oo.ID;
  Hotspot*hh = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
  int h = hh.ID;

  // Other possible extensions could be: Turn On/Turn Off
  
  // Open/Close Extension:
  // Room | Hotspot |(Door_id)


else if (r==20 && o == 0) {  //trying to get object[0] in room20 to flip between open/close verb Extension
    if (oo.GetProperty("Pushed") == 0) Verbs.AddExtension('y');
    else Verbs.AddExtension('s');
}
}

}

and in the room scripts object 0's anyclick  i have this

Code: ags
  if (Verbs.UsedAction(eGA_Open) && oGate_LEFT.X==0)

{
    oGate_LEFT.SetProperty("Pushed",1);

  player.Walk(460, 2250, eBlock);
  player.FaceDirection(eDirectionUp, eBlock);
  aGate_Open.Play();
  oGate_LEFT.Move(-82, 2400, 1, eNoBlock, eAnywhere);
  oGate_RIGHT.Move(82, 2400, 1, eNoBlock, eAnywhere);
  RestoreWalkableArea(3); 
 
}


What should i pick in Custom Properties?
i've created a new one in Object[0] properties to my understanding called Pushed and it's set to 0 as a "Number" and what it should apply to i choose "objects" unsure?



Edit: Solved it myself finally! Solution was to change oGate_LEFT to object[0] and change to the right extension's the example is push/pull, i didn't bother changing them since i couldn't even get the custom properties working..
In custom properties it should be number, so anyone else that might wonder this knows now!



#25
What i mean is if you go to one side and then go down or up to the same side. "DOWN/RIGHT" or "UP/RIGHT", etc. it will cancel the ongoing animation and it looks really bad. Say when using a controller like a "d-pad" style beat 'em up game (Sorry i know it's like cursing in Church, but just to get the point across). Probably someone might do a point & click or RPG while using a controller in a "Grim Fandago" stylish manner and it just doesn't look right!

Thanks!
#26
Someone told me long ago if you make a 320x200 game just make a 320x200 game, well yeah...Problem is when you save your game and look at the Thumbleweed save states, you almost can't see what it is a friend told me! (laugh) When loading the Mainscreen i've done a Game.Camera.SetSize(1920x1200); but that doesn't change the Gui's internal resolution which seems to still be 320x200 game's default setting, unclear ???

Thanks!
#27
It was one of the best ideas instead of double tapping, just holding in a button to run!  (nod) I'm unsure why this is not working. Perhaps it's the script of Double-Click that's blocking it somehow. Since i guess it should work in theory, right ???
Edit: I do undestand i need to reset it somehow, i'm just curious as to why this is not working, and how you would do it differently

Code: ags
function repeatedly_execute_always()
{
  
  if (mouse.IsButtonDown(eMouseMiddle) || gamepad.IsButtonDown(3))
  
  {
    player.SetWalkSpeed(10, 10); //Something like this perhaps,  but it's not working..
  }
  
#28
I can't seem to find any options for how to zoom in and have it zoom in at a certain X/Y on the screen ??? 
Looking at the Tween Git Manual something like this should be possible alltho the manual's example uses a GUI and i'm trying the Camera. My Camera.position does nothing in this room, but it works in another wider room, unsure why. Tried putting various x/y's, nothing happens. Atm i'm trying in afterfade.

Code: ags
Game.Camera.TweenPosition(2.0, 1, 300);
Game.Camera.TweenSize(2.5, 100, 100);



Thanks!
#29
I've downloaded modules and just started crying, pretty much. I make zero sense out of them.

I have a file called Wheels.Png and i've put it in the game folder.

Now i've found in the manual this section, but i have no idea how to turn my own sprite in the manual example, just replacing the bmp with my file that i've placed in the folder does not do the trick. An object with the chosen sprite? a view? a character? What is it in this context "a sprite" , cause the autofill won't show my "sprite" file (Wheels.png).
I get a nullpoint error, most likely cause it does not recognise the sprite file.

From the manual:

DynamicSprite* sprite = DynamicSprite.CreateFromFile("Wheels.png");
sprite.Rotate(90);
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawImage(100, 100, sprite.Graphic);
surface.Release();
sprite.Delete();
#30
The footage is basically screencaptured from the game, not all but most. However i warn you, we are talking years from now on, most likely since i'm working way to slow. :-[
The song is ofc mostly done in memory of Eddie Van Halen, but i've always had in my mind that i want a big stage where bands do performances. (nod)
If you want to support, drop a dollar at the link in the ending. That will definately go to voice acting in the future, or perhaps a new drawing tablet! :)

SMF spam blocked by CleanTalk