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

#101
Assign them to the character's view (which by default should be View1).

In View 1 replace the default sprites with your sprites. The character should then be composed of your sprites.

P.S. Have you done the tutorial and tried searching the forum? I've noticed that, previous this topic, there are 3 others (of yours) which basically ask the same question (How to make a working character).
#102
This is how I did it for a game I mad a few months back.

Code: ags

  if (IsKeyPressed(372) == 1) { // Up
    SetViewport(GetViewportX(), GetViewportY()-1);
  }
  if (IsKeyPressed(377) == 1) { // Right
    SetViewport(GetViewportX()+1, GetViewportY());
  }
  
 if (IsKeyPressed(375) == 1) { // Left
   SetViewport(GetViewportX()-1, GetViewportY());
 }
 if (IsKeyPressed(380) == 1) { // Down
   SetViewport(GetViewportX(), GetViewportY()+1);
}
  if (player.Moving == true) {
    ReleaseViewport(); // When the player starts moving again the camera snaps back to his position
}


And I put that in the script of the rooms that were larger than the screen resolution (though you can have it in the Global Script if it's for all your rooms).
#103
Quote from: Gilbet V7000a on Wed 15/10/2008 09:54:56
Even though running the .EXE directly form the compiled folder is a workaround, the lack of the benefit of using the debug features of the editor is a let-down.

Just to clarify, since the game/patch is made with AGS separately from the actual game itself, wouldn't you be able to debug the patch in the editor (hard to explain, sorry if it doesn't make sense)?
#104
Thanks for the quick replys.

Quote from: RickJ on Wed 15/10/2008 08:25:05
Do you have both exe files in the compiled folder?   
Are there any room.crm files in the same folder as the exe files?   
Have you tried doing a "rebuild all" on both games?

Yes.
No.
Yes.

EDIT:
I just tried running the exe (of the first game) from the compiled folder. When I click on the button that activates the (second) game, it works. It was only in the editor that it didn't work. I guess that if I want to test the second game I'll have to run it from the compiled exe (of the first).
#105
I'm trying to run a previous game I've made with AGS 3.0.2 SP1 from another game made with the same version. My code is:

Code: ags

RunAGSGame("Game.exe", 0, 0);


The problem is that when I try to run 'Game' from the previous game I get this:

---------------------------
Adventure Game Studio
---------------------------
An error has occurred. Please contact the game author for support, as this
is likely to be a scripting error and not a bug in AGS.
(ACI version 3.02.1025)


Error: Unable to load 'room1.crm'. This room file is assigned to a different game.

---------------------------
OK   
---------------------------

I know the problem is something to do with room1.crm and the two different game files, but I don't know exactly what, so I was hoping that someone could help me solve this.
#106
Quote from: paolo on Mon 29/09/2008 17:26:58
The above code won't work. The "int"s need to be removed. You give the type of a variable in the definition of a function, not when you call it.

I know that. There's a comment after that line saying that FalseHope has to set his own x and y coordinates.

Quote from: Creator on Mon 29/09/2008 10:06:46
function hEnemy_Interact()
{
  oFireball.SetPosition(int x, int y); // Set your own x and y coordinates.
  oFireball.Visible = true;
  oFireball.Move(int x, int y,  5, eBlock); // Set your own x and y coordinates.
  oFireball.Visible = false;
}

I was just doing it the way the AGS Auto-Finish (or whatever it's called) does. It shows 'int x' and 'int y' when you go to type something in those areas. I'll change it anyway to make it less confusing.
#107
Make a fireball object that's visible property is initially set to false.
Then when interacting with the hotspot:

Code: ags

function hEnemy_Interact()
{
  oFireball.SetPosition(x, y); // Set your own x and y coordinates.
  oFireball.Visible = true;
  oFireball.Move(x, y,  5, eBlock); // Set your own x and y coordinates.
  oFireball.Visible = false;
}


Or make a Fireball Inventory Item and then when using it on the hotspot:

Code: ags

function hEnemy_UseInv()
{
  if (player.ActiveInventory == iFireball) {
    oFireball.SetPosition(x, y); // Set your own x and y coordinates.
    oFireball.Visible = true;
    oFireball.Move(x, y, 5, eBlock); // Set your own x and y coordinates.
    oFireball.Visible = false;
  }
}


Did you even bother to search the forum or try to figure it out (by reading the manual perhaps)?
#108
Quote from: Revonx on Fri 26/09/2008 13:27:33
Yes, but there are no settings for a text window, I'm not talking about an inventory window, label, text box, e.t.c

Woops. Sorry. Didn't read the title carefully enough.
I just checked it out and there doesn't seem to be anyway to control a text box's X and Y coordinates.

Khris's method seems to be the easiest method, though I'd have no way of knowing how to script it.
#109
When you open up a GUI, on the property tree (when no controls are selected) under the 'Layout' sub-category you can set the Height (How tall the GUI is), the Width (How wide the GUI is) and the Left (x) and Top (y) positions.

Without trying to sound rude, did you even look at the GUI settings before posting this?
#110
Create a region (around the couch) and when you interact with it (the couch) use:
Code: ags

function hSladesCouch_Interact() {
if (Region.GetAtRoomXY(cSlade.x, cSlade.y) == region[1]) {
   player.ChangeView(2); //to sit on couch
    SetWalkBehindBase(1, 200);
  }
  else {
    player.Walk(210, 260);
  }
}


Easiest way I could think of.
#111
I had to make a few changes to your code Gilbot to get it to work correctly, but the changes you made where more than enough yo get the extra seconds digit to appear.
This is my code now:
Code: ags

int timeLeftMins;
int timeLeftSecs = -1;
#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() 
{
  if (timeLeftSecs >= 0) { 
    timeLeftSecs--;
   if ((timeLeftSecs < 0) && (timeLeftMins > 0)) {
// Seconds must be less than zero or it jumps straight to *minutes left*:59 from *minutes left+1*:01
       timeLeftMins--;
       timeLeftSecs = 59;
  } 
  else if ((timeLeftSecs == 0) && (timeLeftMins == 0)) {
       Wait(40);
       lblTimeLeft.Text = "Time left: 0:00";
       Wait(1);
       PlaySound(1);
       Display("Times Up!");
       lblTimeLeft.Text = "Time left: ?";
       mouse.Mode = eModePointer;
       return;
  }
  Wait(40);
  lblTimeLeft.Text = String.Format("Time left: %d:%02d", timeLeftMins, timeLeftSecs);
}
}
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE

Thanks a lot for your help.
Also can I ask how or why the '%02d' text puts that extra 0 there?
#112
I'm making a timer that counts down from 4 minutes, 2 minutes and 1 minute. When the timer's second's counter gets to less then 10 I want it to display: 0:09, 0:08 etc.
My code works except that the second the timer reaches "*minutes left*:10" it jumps immediately to "*minutes left*:09" after 1 game loop instead of 40.
Heres my
Code: ags

int timeLeftMins;
int timeLeftSecs;
#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() 
{
   if (timeLeftSecs > 0) {
     if (timeLeftSecs > 0) {
     timeLeftSecs--;
}
     if ((timeLeftSecs == 0) && (timeLeftMins > 0)) {
       lblTimeLeft.Text = String.Format("Time left: %d:0" , timeLeftMins);
       timeLeftMins--;
       timeLeftSecs = 59;
}
     if (timeLeftSecs < 10) {
       lblTimeLeft.Text = String.Format("Time left: %d:0%d", timeLeftMins, timeLeftSecs);
  }
     if ((timeLeftMins == 0) && (timeLeftSecs == 0)) {
       Wait(40);
       lblTimeLeft.Text = "Time left: 0:00";
       Wait(1);
       PlaySound(1);
       Display("Times Up!");
       lblTimeLeft.Text = "Time left: ?";
       mouse.Mode = eModePointer;
       return;
    }
      Wait(40);
      lblTimeLeft.Text = String.Format("Time left: %d:%d", timeLeftMins, timeLeftSecs);
}
    // put anything you want to happen every game cycle here
  }
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE


Can anyone help please?
(Using AGS 3.0.2 SP 1 if that helps)
#113
It works fine now (with SP1). I just need to test it at school (which is where it wasn't working and where I need it to work most due to a media project). I'll edit this post later with details on what's happening.
#114
I was using 3.0.2 not the service pack.

It works now (after downloading SP1)... on my PC. On some other computers it still comes up with the same message. Putting the sprite file in the compiled folder makes it run, but who knows how long that'll last.

At least it works for now. Thanks for the SP CJ.
#115
When I try to run my game from the compiled folder I get this:

"Could not load sprite set file ACSPRSET.SPR
This means that the file is missing or there is not enough free system memory to load the file."

It works fine when trying to run it from the editor. I'm using AGS 3.0.2 and it worked fine a few days ago. This also happens on other peoples computers.

Things I've tried:
Adding the sprite file to the compiled folder (which used to work, but not anymore)
Compiling it without debug mode (didn't work)

Any clue as to why this is?
#116
Did you check that iBottle_Look() is actually defined in the inventory window properties by clicking on the lightning bolt?

EDIT: Never mind. Saw you followed the tutorial. Must actually read the posts, not skim. Maybe the 'Look' button on the GUI doesn't change the cursor to 'eModeLook'?
#117
Quote from: nads on Sat 26/07/2008 18:08:24
Sound Sample load failure: Cannot load sound 0.

I think that your trying to play "Sound 0" instead of "Sound 1". Try changing the number in the interaction editor to match with the number of the sound file.

An easier way would be to use the Run Script command and type in:
Code: ags

PlaySound(1); // Plays keyboard typing sound


Much more simple.
#118
If anyone has used C++ before, they should know that you can add blocks of comments stretching over more than one line by using this text:

Code: ags

/* This is a block
of comments */


and that would be the same as:

Code: ags

// This is a block of comments


I just found out that AGS is the same. You can make comments stretch over multiple lines by using the slashes and asterisks.

Did anyone notice this before me?
#119
If you still haven't figured it out:

Usually you right-click the V-Shield Icon on your task bar and then click 'Disable On-Access Scan'.

Don't know if it's right for you, but meh, worth a shot.
#120
You cannot change the default quit GUI, but you can make a new one.
Start off with making a new GUI and call it something like: gQuitgui.
Put a label on there that says something like: Do you really want to quit?
Now make two buttons: one that says 'Yes' and the other that says 'No'.

Scripting for the buttons:
Yes:
Code: ags

QuitGame(0);


No:
Code: ags

gQuitgui.Visible = false;


When you want the quit GUI to pop up, run this script:
Code: ags

gQuitgui.Visible = true;


Sorry, but that's the easiest way with 3.0.1.
SMF spam blocked by CleanTalk