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

#1
Hello!

Situation:
- the player (cEgo) is in room 53
- The NPC is in room 52
- When the time runs out and if the player is not in room 52, another character, cNPC, will take over in room 52

Here's the code in Global script:
Code: ags

if (IsTimerExpired (19))
  {
    if (cEgo.Room != 52)
    {
      cNPC.SetAsPlayer();
      cNPC.Walk (1239, 458, eBlock, eWalkableAreas); // <<<< [b]ERROR HERE[/b]
      cNPC.FaceDirection (eDirectionRight);
      cNPC.Say ("Oh well...");
      aElevatorOpen.Play();
      // STUFF happening
    }
  }


The error I get is: "Character is not in current room".

I managed to change rooms with SetAsPlayer before, but in this case it's the Timer that triggers the switch and there's a cutscene following automatically.

Any ideas?
Thx!

EDIT : When I remove everything cutscene after cNPC.SetAsPlayer(); the switch works
#2
Yeah, sorry, but I couldn't find a better title for this one.

Here's my problem: It's a minigame. An "attack object image" appears on the left and moves to the right.
To stop it, player has to click on an object-image that will make the left laser appear.
When the Attack object X == the Laser X they both disappear.
And this one is working.

I copy/Pasted the code for the RIGHT attack object, which means the same happens from the right but the attack object appears on the right and moves to the left and if it hits the right laser, they both disappear, too.
And this one is NOT working for some reason. (When the Right Laser X hits the Right Object X)

So:

Attack from left > if (oAttackLEFT.X == oLaserLEFT.X-75 && oLaserLEFT.Visible == true) is working
Attack from right> if (oAttackRIGHT.X == oLaserRIGHT.X+75 && oLaserRIGHT.Visible == true) is NOT working, the "collision" doesn't happen


I might be missing something really stupid here; here's the code:

In Room Load:
Code: ags
oAttackLEFT.X = 209;
oAttackRIGHT.X = 892;

int L = Random (2); // AttackLEFT
if (L == 0) SetTimer (3, 40);
else if (L == 1) SetTimer (3, 80);
else if (L == 2) SetTimer (3, 120);
  
int R = Random (2); // AttackRIGHT
if (R == 0) SetTimer (5, 40);
else if (R == 1) SetTimer (5, 80);
else if (R == 2) SetTimer (5, 120);

In Room Rep_Exec:

Code: ags
//////////////////////////////////////////// Attack LEFT
  if (IsTimerExpired (3))
  {
    oAttackLEFT.Visible = true;
    SetTimer (4, 3);
  }
  if (IsTimerExpired (4))
  {
    oAttackLEFT.X += 1;
    SetTimer (4, 3);
  }
  if (oAttackLEFT.X == oLaserLEFT.X-75 && oLaserLEFT.Visible == true)
  {
    oAttackLEFT.Visible = false;
    oLaserLEFT.Visible = false;
    oAttackLEFT.X = 209;
    SetTimer (4, 0);
    int L = Random (2);
    if (L == 0) SetTimer (3, 40);
    else if (L == 1) SetTimer (3, 80);
    else if (L == 2) SetTimer (3, 120);
  }
 //////////////////////////////////////////// Attack RIGHT
  if (IsTimerExpired (5))
  {
    oAttackRIGHT.Visible = true;
    SetTimer (6, 3);
  }
  if (IsTimerExpired (6))
  {
    oAttackRIGHT.X -= 1;
    SetTimer (6, 3);
  }
  if (oAttackRIGHT.X == oLaserRIGHT.X+75 && oLaserRIGHT.Visible == true) //// [b][u]THIS IS THE PART THAT'S NOT WORKING[/u][/b]
  {
    oAttackRIGHT.Visible = false;
    oLaserRIGHT.Visible = false;
    oAttackRIGHT.X = 892;
    SetTimer (6, 0);
    int R = Random (2);
    if (R == 0) SetTimer (5, 40);
    else if (R == 1) SetTimer (5, 80);
    else if (R == 2) SetTimer (5, 120);

And here's the "buttons/objects" code:

Code: ags
function oLeft_Interact(Object *theObject, CursorMode mode) // AttackLEFT
{
  if (oAttackLEFT.Visible == true)
  {
    oLaserLEFT.Visible = true;
  }
}

function oRight_Interact(Object *theObject, CursorMode mode) // AttackRIGHT
{
  if (oAttackRIGHT.Visible == true)
  {
    oLaserRIGHT.Visible = true;
  }
}

I did try to use IsCollidingWithObject, which I used before, but in this case they're PNG images with some "empty room" around them so that's no use in this case.

But the LEFT attack script works so I don't know why the RIGHT attack doesn't.

And again, I might have missed something stupid but I just don't see it.

Any ideas?


#3
So I tested this in multiple "Released games" posts. And when I click on the AGS database links I'm redirected to a blank page.

Example: For the released game "Save me this jazz", I get a blank page and in the browser thing there's this:

"https://www.adventuregamestudio.co.uk/play/game/2850/"

But there's nothing on the page. It did work some days ago, but now there's nothing. ???

I'm sure you guys will figure this out and thank you for all your time and work on the website!  (nod)

#4
Site & Forum Reports / The Calendar
Tue 11/02/2025 18:49:51
Before @mkennedy pointed it out on the AGS awards thread, I didn't "really realize" it existed.

So now I have questions, because I didn't dare to post an event to test it. :P

How does it work and how can we use it as a community?
Can we use it to announce game releases or something else?
And how is it supposed to work in the forums if we already have a thread about our game?

Cheers! :)

#5
Hiya,

I'm trying to have to player move from point a to point b, while playing an animation in NoBlock.

1: player walks to place
2: player starts animation in repeat & noBlock
3: player MOVEs to next place in Block

Code: ags
player.Walk (1300, 318, eBlock, eWalkableAreas);
player.Animate (21, 2, eRepeat, eNoBlock); // animation starts
player.Move (1925, 315, eBlock, eAnywhere); // moves from a to b
player.Walk (1921, 350, eBlock, eAnywhere);

Everything is working fine BUT the player moves from point a to b way too fast. Like "whoosh".

The question is: is there a way to make the MOVE part from point a to b to be much slower?

I'd like to avoid creating a new View if it's possible?

Thx! :)
#6
For the moment, Andreas Black isn't able to post this one in the forums because of some error.

His message:
Spoiler
Can't seem to be able to post in the forum. I have no idea what happened it whines about "cleantalk" and i get an error. If you want to save rock'n roll post this message in my thread. Art/Music on the critics section of the forum, you know where it is!  (nod)
[close]

While he figures it out he asked me to post it so here goes 
//
The people asked for it (People meaning Rik Vargard (laugh)) and i deliver Rock'n Roll (at least i think so)
Here's two trailers for my new song, anyone feel like supporting can do so by
Pre-saving it here: https://share.amuse.io/track/max-fury-superpowers

ENJOY! @Rik Vargard and anybody else that likes old school rock'n roll with a big choir of voices!

Trailer 1 (Chorus of the Song):

Trailer 2 (Beginning of Guitar Solo):

@AndreasBlack
#7
I don't know if this a 3.6.1 version thing or if I more likely did something to my game, but when I select an item in the inventory window and then use it on a hotspot without closing the window first, the code goes on like I want but the GUI window stays open.

So I returned to my previous game to check that out (v3.5) , and when I try to use an item while the GUI is still open, I have to close it first.
That's what I need.

I do remember that I imported the GUI from my previous game, deleted the default one and renamed the new one "gInventory2" so there might be some code missing.

I also use the gGUI.Visible = true/false and not the open/close_gui thingy.

What do you think I should do to fix this?

Thanks!  :)
#8
There's that really helpful visual thing when you post AGS code into forum posts.
I used the Code Button to share code in my reply. All great.
Then I saw a typo and clicked on the "Quick edit" button.
And, visually, the code part wasn't there anymore like it's supposed to be (that dark visual)
So I clicked on "More > Modify" and then it wall alright again.

Cheers :)
#9
I learned, back in time, the hard way why I can never underestimate the frustrating time to back up my work.
This week, I had a suddent blackout out of nowhere, but since CTRL+S has become a reflex at all moments, it was OK.

Yesterday, I had to install a big Windows 11 update.
Distracted like I apparently like to be, when the PC was ready to shut down, there was that message that I forgot to close AGS.
Thus I clicked Cancel.
There was that AGS window when you close "Do you want to save?"
I clicked "Save" and then I relaunched the update.

IF you forget to close AGS when restarting or shutting down and then go back to save like I did, click "Cancel" and then save properly.
Because when, after the update was done and I restarted AGS, ALL of my 3200+ sprites in AGS had disapeared from the AGS sprites tab.
All the sprites in the Views had also disappeared. In short, it was all gone.

My game folder is like 52 Gb (but I have a lot of 3D Blender and Video files etc)
Anyway, I have a daily backup on my C, D and external E drive. and it takes like 30 minutes each.
And the Google Drive Backup take more than 3 hours every week.

Never be too confident about just saving your game believing it will be OK tomorrow morning.
Shit can happen anytime!

And voilĂ , just sharing  :P  (laugh)


#10
Hey, just thinking for me here:

It would be nice to have a blur effect as option for the walkable areas.
Just like the Scaling effect.
The smaller/further away you are, the more blurred the charater is.
I think it would create some great visuals, like a basic FOV for cameras.

Cheers!  :)

#11
I'd like to have a certain character to use a specific speech font.
Is that possible?
I use version 3.6.1

Cheers!
#12











DOWNLOAD THE DEMO!

AGS DATABASE | ITCH.IO



Well, I hope you'll have fun playing the demo! :)
Cheers!
#13
It happened just like that, out of the blue. I hit F5 and now I get this everytime:

Any idea on how to fix this?
I reinstalled, restarted my PC etc... but nothing changes the problem.

#14
Hello,

So that's the thing I can't solve right now:
When opening a GUI, all the object animations pause, and I don't want that.
What can I do so the object animations continue even when I open a GUI?
Pop-up Style is > When mouse moves to top of screen

Thx!
#15
Hi, I'm trying to implement an autosave to my game, and as far as I know it works with this line of code:

SaveGameSlot(99, "AutoSave");

But when I load the Autosave, the mouse buttons don't work anymore, right or left click are "inactive".
And also, sometimes the player character isn't there anymore.

Any ideas?

Thx!
#16
Hints & Tips / Stormwater Demo
Sat 27/01/2024 21:13:35
I don't get it... I must be missing something, or a gameplay thing.
I'm stuck at the very beginning.

Spoiler
So I'm walking around and around and I can't find out what to do to open the gate.
The shells have disappeared I think. I follow the blood trail but get back to the main road.
There's that bucket, the rotten food(?)... well if someone has a hint...?  :P
[close]
#17
Hello,
This is the minigame I'm working on :

You have to collect ressources by moving the bucket left and right.
The left and right arrows are GUI buttons and players can click on it to move the bucket.

Now, I also want to give the players the option to use the right/left arrow keys.
But when I click on those keys, the bucket goes from left to right without stopping in the middle.

Unless I tap really fast/shortly on the arrow keys! Then it works.

My question is: is there a way to make a normal key pressing just move one place?

This is the code I'm using:

Code: ags
if (IsKeyPressed(eKeyLeftArrow))
  {
    if (object[3].X > 500)
    {
      aConductors_01.Play();
      object[3].X = object[3].X - 70;
    }
  }
  if (IsKeyPressed(eKeyRightArrow))
  {
    if (object[3].X < 640)
    {
      aConductors_01.Play();
      object[3].X = object[3].X + 70;
    }
  }

Thx! :)

EDIT PS: Those lines are in room_RepExec() because that's the only place it kinda "works."
#18
Hello, I filled in all the info to add my game to AGS, and when I click on the "Add Game" button, something seems to load and then I have an empty page.
I tried it twice... and I don't know if it worked or not?

Any ideas?
Thx!
#19

[Enter Name] has grown up in the orphanage of Metro City, capital of planet Antoryos, and thus has been given a role to participate in society by becoming a police officer.
with police academy friend Darcy they choose to patrol at night because of the ambient created by the lights of the city.


DOWNLOADS :



#20
I have that .ogv file that's working fine in any video reader.
But when I launch it in AGS, the video part goes like twice as fast as the music, like they are unlinked.

Here's the code (I've tried it all :

PlayVideo("Music-01.ogv",eVideoSkipNotAllowed, 1);

.avi files work just fine in AGS, but I'd like to know why .ogv ones don't.

Anyone having experience in using videos in AGS?

SMF spam blocked by CleanTalk