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

#361
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.

If you want an animated fireball that moves across the screen, this can be done using a loop in which you change the position of the fireball a certain amount each time round the loop (and then probably pause for a fraction of a second, or else it will all happen too fast). This is basic scripting that you can find out more about in the AGS manual.
#362
This is Indiana Jones from around what time? The face looks very boyish, as if he is a teenager. If this is "traditional" Indy rather than young Indy or Crystal Skull Indy, then he should look (early) middle-aged and rugged. The face needs to be aged. Sorry, no paintover as art is not my forte.
#363
Wow!

Ben, as far as I'm concerned, there is nothing that needs to be changed here. This picture is stunning!
#364
Critics' Lounge / Re: Animating A Ghost
Wed 17/09/2008 16:53:08
Here's an idea... if you make it move up and down (say) one pixel per frame (so its vertical position is 1, 2, 3, 4, 5, 4, 3, 2 pixels off the "ground" in each successive frame), it will look unnatural. Objects that bob up and down slow down gradually as they reach the top and bottom of their cycle. You'll get a more natural effect if you use something like:

1, 2, 4, 6, 7, 6, 4, 2 pixels off the ground

or

1, 2, 4, 8, 10, 11, 10, 8, 4, 2 pixels off the ground

depending on how many frames there are in your animation. (By the way, to get those numbers, I started with 1, added 1, then added 2, then 4, etc, then worked backwards through those increments until I reached the maximum value, then repeated the other numbers in reverse order.)
#365
Quote from: Akatosh on Sun 14/09/2008 10:40:06
I'm not sure if that helps in this case, too, but sometimes such problems can be fixed by inserting a Wait(1); at the right point (after changing the views) so the game engine has time to update.

Flaming Nora, would you believe it, it worked!

I am surprised, because I know of this trick for functions that can block optionally (that is, functions that have an eBlock/eNoBlock parameter) but this is not the case for ChangeView.

Thank you so much! You've just saved me from hours of debugging hell.
#366
I'm having problems with my script actions happening in the right order with FadeOut and FadeIn. This question has been asked before several times on this board, and I'm aware that FadeOut and FadeIn work in mysterious ways :D but I don't see anything that helps me with my problem.

Here's what I want to do:

* Fade to black
* Wait a moment
* Change character's views
* Fade back up

The idea is that the character gets changed while the screen is faded out.

Here's my (slightly disguised) code:

Code: ags

FadeOut(2);
Wait(10);
cFred.ChangeView(3);
cFred.SpeechView = 4;
FadeIn(2);
Display("blah blah blah");
cFred.Say("Fred says something here.");


And here's what happens:

* Screen fades to black
* Game pauses (verified by changing 10 to 100)
* Screen fades back in
* "blah blah blah" is displayed
* Fred's view changes
* Fred says "Fred says something here."

So the views are changed after the FadeIn and Display commands have executed, as if changing view has to wait for blocking actions to complete. Is this true? How can I get this to work without messing around with testing stuff in repeatedly_execute (which would probably work, but seems to be unnecessarily complicated)?

I'm using v2.71, by the way.

Thanks for any help.
#367
Quote from: Duckbutcher on Sat 13/09/2008 15:16:57
Could the fact I'm using the Proskritos MI2 template be relevant in any way?

[snip]

Error: run_text_script1: error -6 running function 'repeatedly_execute':
Error: Null pointer referenced
in Global Script (line 265)
from Global script (line 710)

The lines it mentioned are as follows:

265:  madetext=String.Format("%s%s %s ", madetext, RemoveExtension(player.ActiveInventory.Name), Tmode[mode].preposition);

710: UpdateActionBar(mouse.x+GetViewportX(),mouse.y+GetViewportY());

Yes, it could very well be to do with the fact that you are using a different user interface from me. I'm not familiar with the template you are using, so that might be a problem.

One thing - did you copy and paste my code exactly? You've got cMouse, iMouse, Mouse and mouse in the code I posted - getting one of these wrong would cause problems, although it would be more likely that your game would not compile rather than it would compile and then crash when you run it.

Quote from: Duckbutcher on Sat 13/09/2008 15:16:57
Sorry, this seems to be going on for ever and ever...

Welcome to the wonderful world of programming :) Don't worry - it always takes a few tries to get something working.

Sorry I can't be of any more assistance. I'm sure someone else will be able to help you out here.
#368
Quote from: J.E.S. on Sat 13/09/2008 00:47:53
@Joe Carl...I was able to get your code to work and I thank you for helping me. What I'm trying to do now is apply this functionality to the rest of the buttons on my gui(save, load, quit....etc). Is there a way I can do this with minimal code or will I have to cut and paste this same code for each button?

For more than one button, you'll need more than one "played" variable and checks for each of the buttons:

Change the code at the top of the global script to this:
Code: ags

bool playedResumeGameSound = false;
bool playedSaveSound = false;
bool playedLoadSound = false;

and so on, for each button.

Then in repeatedly_execute, change every instance of "played" to playedResumeGameSound. Then add exactly the same code underneath for playedLoadSound, etc, changing playedResumeGameSound to playedLoadSound, and so on for each of your buttons. That should do the trick.

It's probably possible to factor this code out into a function of its own to cut down the amount of copying and pasting you'll need to do, but I'll leave that to someone else to do.
#369
Quote from: Duckbutcher on Sat 13/09/2008 00:09:54
Thanks a lot for your help. I'm using AGS 2.71, but I'm sure I'll be able to get this working.

You're welcome. Ah, if I'd known you were using AGS 2.71 I'd have coded it up there. Never mind. The above code should work in 2.71 as well, provided you put it in the right place in the scripts (use the "i" button for the room to get the room interactions and the "Interaction..." button for the mouse character to get its interactions).

Quote from: Duckbutcher on Sat 13/09/2008 00:09:54
I was hoping to have the function activated simply by "Using" the item, rather than "using it on" something, ie a hotspot,  that way it would work in any room and wouldn't be tied to a specific one.

I don't understand what you mean by just "using" the item. Generally you have to use an item on something before anything happens. Do you mean that just selecting the mouse item in the inventory with the "use" cursor makes the mouse appear? That is, so that "Use mouse on" would appear (briefly) as the name of the action, but then you wouldn't need to click anywhere else for the mouse to appear? That is what I thought you meant in the first place. I'll have another go at doing this.

EDIT: OK, this works for me:

* Remove the code you wrote for interacting with the hotspot (the code in hHotspot1_UseInv(), or whatever the function is called in 2.71)
* Put the following code in repeatedly_execute() in the global script:

Code: ags

  if (gInventory.Visible && cEgo.ActiveInventory == iMouse) //has user selected mouse?
  {
    cEgo.LoseInventory(iMouse);
    cMouse.x = cEgo.x + 20;
    cMouse.y = cEgo.y;
    cMouse.on = true;

    Mouse.Mode = eModeInteract;
    gInventory.Visible = false;
  }


When you click on the mouse in the inventory, it will appear next to Roger and will disappear from the inventory. The inventory window is closed and the mouse cursor goes back to "interact" mode (otherwise the cursor would still be the mouse inventory item).
#370
OK, I've written a test game and got this working. It's much simpler than you might think!

Assuming you have the following:

* A character called cMouse
* An inventory item called iMouse, which the player either starts out with or has obtained during the game

and that you are using AGS 3.0, do the following:

* Scrap the code for putting down the mouse that you have written so far.
* Create a hotspot in your room that covers the floor area; call the hotspot hFloor
* From the "Show this room's" menu for the room, select "Hotspots".
* Click on the lightning icon, then click to create a function for "Use inventory on hotspot" (the automatically generated function should be called hHotspot1_UseInv).
* Write this code in hHotspot1_UseInv():

Code: ags

  if (cEgo.ActiveInventory == iMouse)
  {
    cEgo.LoseInventory(iMouse);
    
    if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hFloor)
    {
      cMouse.x = mouse.x;
      cMouse.y = mouse.y;
      cMouse.on = true;
    }
  }


* Select "Nothing" from the "Show this room's" menu.
* Click on the lightning icon, then click to create a function for "Enters room before fade-in" (the function should be called room_Load)
* Write this code in roomLoad():

Code: ags

  cMouse.on = false;


* Go to your mouse character.
* Click on the lightning icon, then click to create a function for "Interact character (this function should be called cMouse_Interact).
* Write this code in cMouse_Interact():

Code: ags

  cEgo.AddInventory(iMouse);
  cMouse.on = false;


And that should be it... let me know if this works now.

What I've done is made it so that the mouse will be put down at the point where you click on the floor. If you click somewhere that isn't the floor, the mouse won't appear.

Making the mouse move around of its own accord, assuming that this is what you want to do, is another matter :) Broadly speaking, though, you'll want something in the repeatedly_execute function of the global script that does the following:

Code: ags

if (cMouse.on)    //is the mouse on the floor?
{
   //do something here to move the mouse around
}


#371
What line is the unexpected if on? Can you give the code where it is complaining about the if? (It might not be the code you have already posted.)

The other thing might be that you need to use your mouse inventory item on something for the script to be triggered. I assume that you now want to do the following:

* Select mouse in inventory
* Use mouse on ground - mouse appears on ground and is removed from inventory.

You could try creating a hotspot or region on the ground (either one should work) and then moving this code:

Code: ags

if (Mouse.Mode == eModeUse && cEgo.ActiveInventory == iMouse)
{
    cEgo.LoseInventory(iMouse);
    cMouse.x = 150;    //or wherever you want the mouse to be
    cMouse.y = 125;    //or wherever you want the mouse to be
    cMouse.on = true;
}


from where it is and into the code for any click on the hotspot or region. (Alternatively, if the function exists, you can put it in the function for interacting with the hotspot/region and then you don't need "Mouse.Mode == eModeUse && ".)

Then, if that works, you can do something clever like replacing these two lines:

Code: ags

    cMouse.x = 150;    //or wherever you want the mouse to be
    cMouse.y = 125;    //or wherever you want the mouse to be


with

Code: ags

    if (GetRegionAt(Mouse.x, Mouse.y) == 1)
    {
        cMouse.x = Mouse.x;
        cMouse.y = Mouse.y;
    }


for a region, or the equivalent for a hotspot, where 1 is the number of the region or hotspot (change this as appropriate).

Note that the above is very likely not correct AGS code (again, this is half-remembered stuff) but what this will do is make the mouse appear where you click provided that the point where you clicked is somewhere in the ground region or hotspot.

Again, I'm sure someone else can turn this into correct AGS code for me :)

If this still doesn't work, I'll have a look to see if I can knock something up in AGS over the weekend.
#372
You have an extra ) in the following line:

Code: ags

SetGraphicalVariable("ratvar"), 0);


I think it should probably be:

Code: ags

SetGraphicalVariable("ratvar", 0);

#373
Ah, yes - thanks for the corrections to my half-remembered AGS functions (I posted my code from a PC that does not have AGS installed).

Quote from: KhrisMUC on Thu 11/09/2008 18:23:06
Put it near the character's feet by setting the cMouse's coords to something like player.x+Random(10)-5, player.y+Random(6)-3.
Alternatively, check which way the player is facing and drop it in front of him.

Nice suggestion. I thought about putting it near the player after I'd posted. Esprit d'escalier (http://en.wikipedia.org/wiki/Esprit_d%27escalier)...

Quote from: SSH on Thu 11/09/2008 15:40:08
To make a character disappear you need to do:
cMouse.Room=-1;

not cMouse.Visible=false;

and the opposite is cMouse.Room=player.Room;

An alternative way of disabling and hiding a character is as follows:

Code: ags

cMouse.on = false;


and then of course

Code: ags

cMouse.on = true;


to turn the character back on.
#374
Just off the top of my head (no guarantees this will work), I might do this as follows:

In the repeatedly_execute function for the global script (which will be executed in every room):

Code: ags

if (Mouse.Mode == eModeUserInv && cYourCharactersNameGoesHere.ActiveInventory == iMouse)
{
    cYourCharactersNameGoesHere.LoseInventory(iMouse);
    cMouse.x = 100;    //or wherever you want the mouse to be
    cMouse.y = 100;    //or wherever you want the mouse to be
    cMouse.Visible = true;
}


Then to pick the mouse back up, write the following in the function for interacting with the mouse character:

Code: ags

cMouse.Visible = false;
cYourCharactersNameGoesHere.AddInventory(iMouse);


iMouse is the name of the mouse inventory item, and cMouse and cYourCharactersNameGoesHere are the names of the mouse and player characters, by the way.
#375
I'm looking for this thread in which Grundislav offered a role to an AGS member in this game (the prisoner in the second cell). Can anyone remind me where that thread is, please?

EDIT: Thanks, cat!
#376
Quote from: olafmoriarty on Tue 26/08/2008 21:31:03
Quote from: paolo on Tue 26/08/2008 18:52:15
Spoiler

* The guy smoking outside Bianchi's house says "au revoir", which is French. Is he supposed to be Italian? Does he think that Ben is French? An Italian would have said "ciao", "arriverderci" or "buongiorno".
[close]

Based on the commentary track, I would say it seems as if
Spoiler
this guy is French.
[close]

Ah, that all makes sense then. I must have overlooked that. Thanks.

I'm playing again with the talking and music on. It's really cool!

Another typo:
Spoiler

"hotel arrangments" (Simon says this on the phone)
[close]
Would Simon say "haven't gotten around to it", I wonder, as he is English? We say "haven't got round to it" in the UK. Then again, maybe he is just using American English for Ben's benefit - I know I do this sometimes to American friends (eg, saying "vacation" for "holiday") so they understand what I am saying. Or maybe he has just spent so much time with Ben that he has got(ten) into the habit of using American English.
#377
Whew, just finished. I found the game plodded along a bit unexcitingly in the middle but that soon changed towards the end.

Bugs and odd things I found that I don't think have been mentioned yet:
Spoiler

* After you have taken Bianchi's keys, if you return to the hotel and ask Alice's advise, she said that you should go to Bianchi's apartment but not alone; however, you can no longer invite her. Perhaps this is not really a bug, because of course Ben does not have to take Alice's advice.
* It should be "Chi-Rho", not "Chi-Ro".
* When you leave the confessional and go back to the previous screen, the cardinal walks up to you and starts looking at the statue again. He doesn't seem to think it odd that you are already there. Again, maybe there is nothing wrong with this, as maybe the confessor leaves the confessional before the priest - I am not Catholic so I have no idea how this works.
* The guy smoking outside Bianchi's house says "au revoir", which is French. Is he supposed to be Italian? Does he think that Ben is French? An Italian would have said "ciao", "arriverderci" or "buongiorno".
[close]

An observation (slight spoiler):
Spoiler

Anyone else think that the cardinal looks like George W Bush? Was that deliberate? (Is Grundislav a Democrat? :))
[close]

A (joky) theory about the ending (spoiler)...
Spoiler

Alice is gone, and Percival shows up... isn't it obvious what is going on here? Alice and Percival are the same person! Have we ever seen them in the same room together? Not in this game, at least. After all, Percival is an anagram of "Alice PRV" (no idea what PRV might stand for).
[close]
#378
General Discussion / Re: AGS forum problems
Sun 24/08/2008 09:22:51
Yeah, Ben Jordan 7 comes out and then bam! the forums go down and there was nowhere to ask for help with the
Spoiler
box in Bianchi's apartment!
[close]
Oh, the frustration of it!
#379
Completed Game Announcements / Re: The Vacuum
Sun 24/08/2008 08:28:58
I enjoyed playing this game, even though, since I am preparing the Italian translation, it was slow going because I was translating it while I was playing it. Having all the text in front of you also means you see spoilers, so I knew who the culprit was before I had got very far. :-\ Oh well, that's the price you pay for being involved in the creation of a game.

I have a few bugs to report:
Spoiler

* There are two separate points in the game where Leo can ask Paulina about where she is going, and each time she tells you she is going her cousin's wedding. However, the second time, the conversation proceeds as if Leo didn't already know (of course, Leo might or might not have asked her the first time). She also doesn't mention that her cousin is female, but Leo guesses this before she refers to her cousin's sex (when Leo says "Yeah? Pleasant fellow?", I thought this referred to the cousin, but it actually refers to the cousin's fiancé).
* Leo tells Chisholm that he has put the circuit board in before he actually has [already mentioned above]
* The control panel outside the blast door that leads to the storage area is open, but when Leo goes through the door, the same control panel is closed.
* Leo is told where the others will be in the cargo bay: "Climb down, and we'll be in the first corridor on your left." When Leo reaches the bottom of the ladder, he has his back to the containers, so his left is to the right of the game. The corridor you are supposed to go into is actually to the left, that is, to your right. (You could argue that as Leo will be facing the containers as he climbs down the ladder, so then the corridor will indeed be on his left, which means that these instructions are indeed correct. However it's a little confusing when you get to the bottom and Leo is facing away from the containers to know which way he is meant to go.)
[close]

I have found quite a few typos (around a dozen - quite a small number, actually, given the sheer quantity of text in this game) so might I suggest to David that he holds off on correcting typos for a possible future release until I finish my translation and submit them to him. Correcting typos in the English text will mean that all translation files have to be updated too in order that the revised text gets translated when the game is played another language, so it might be better to wait until I am able to give him all the typos I have found before he makes a new executable available to download.
#380
I think AGP is asking whether the rooms in a game are stored in a 2D array, so that moving off the right edge of room "x" in one row of the array takes you into room "x + 1" of the same row. Similarly for the other three directions. So, for example, if you had 50 rooms, these might be in an array of 10 rows of 5 rooms each, so that moving right from room 6 would take you to room 7, while moving down from room 6 would take you to room 11.

But AGS doesn't work like that - there are no real links between rooms. When a player leaves a room, you can use the ChangeRoom function to move the player to any room you like in the game. So, for example, when the player exits room 6 by crossing the right edge of the room, they might end up in room 4 because that is how you have programmed the game to work (with something like cEgo.ChangeRoom(4)).

So you can think of the "links" between rooms being like hyperlinks on a web page - the pages and sites that the links take you to are not in any actual physical order - the way you move between them is up to you.
SMF spam blocked by CleanTalk