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 - Trent R

#321
Yeah, click the Interact hotspot (just like the Tutorial Part 3) and it should create hKey_Interact() (or whatever it's named).

Then put the following inside the curly brackets of the new function.
Code: ags
oKey.Visible = false;
hKey.Enabled=false; //make sure you add this line to oKey_Interact as well!
player.AddInventory(iKey);
GiveScore(1);



That's the simple version, and that's really all you need right now.
~Trent
#322
Don't know if it makes a difference, but I'd move the *100 up a line, rather than putting it inside the SetTimer call.

But, it might not even matter.

~Trent
#323
I was coming back anyways, after I realized that I pretty much wrote a nicer-sounding RTFM post.


Quote1. Is there a way to do this with the current key image?(I'm using the one that came with AGS) Or do I have to make my own?
Basically no... You could make it a character, and use scaling... but that's really avoiding the problem and throwing in a useless solution. You can export sprites though (right-click and choose 'export to file')

Quote2. Where exactly do I put @OVERHOTSPOT@? I tried adding it in the script underneath "givescore" and got this:
@OVERHOTSPOT@ is a special keyword that is recognized by Gui labels. Read more about in the manual here. It's simple and explains it better than I could.

Quote3. I copy past oKey_Interact into which box?
Answer coming soon! BRB Two answers:
Simple version: Just click the ...button under Interact with hotspot, and it'll create a new function in your script. Copy-paste all of the code into that function as well (plus the hotspot.enabled command).

Detailed explanation: The ...button makes a function for you automatically, but it isn't really necessary. If you had
Code: ags
function I_AM_A_PIG() {
//do stuff in I Am A Pig function
}
that function in your script, you could put I_AM_A_PIG in any of the boxes under the events tab (lightning bolt). That just tells which function to call when you interact, or look, or whatever. What I meant before is that you can put the name of your object's Interact function there, since they'll do the same thing--and you won't have to duplicate the code.



Any questions?
~Trent

#324
Well, since this isn't your main project--and you're just going through the tutorial.. I'd say don't bother.

Once you feel more comfortable with AGS and with Scripting, then come back to this and you'll understand it a lot easier. Or you might have figured it out on your own before then!


But if you still want me to explain, I totally can.


~Trent
#325
A few ways to fix or workaround. (or use all 3!)

1) Make the object bigger.

2) Put a @OVERHOTSPOT@ in your status line. This will help the player know when the mouse is over the object.

3) Slightly-complicated scripting*:Create a hotspot around the object, link the hotspot's interact function (via the lightning bolt) to the same function of the object (copy-paste oKey_Interact into the box by the ..., and then press it to see if it is properly linked--it should jump to that function.) Finally, add hKey.Enabled=false; (or whatever you called the hotspot) after the line oKey.Visible = false;


~Trent
*At least more so than the tutorial.
#326
If it's in the 'after fadr-in' code, it'll only be run once. For recurring events, use rep_exec.


~Trent
#327
Nothing happens? Or does one happen and not the others?

Have you created the event correctly with the ellipses (...) button? Perhaps the object isn't big enough and leads to a pixel hunt.



~Trent
#328
Quote from: SSH on Fri 27/03/2009 10:27:40
Does QuitGame(0) quit immediately, or wait until the current script is finished? If the latter, it would make more sense that any other postponed tasks (like, e.g. a SaveGameSlot waiting to happen) would occur before the quit...
SSH, this reminded me of Khris's suggestion for eEventQuitGame in the wishlist thread....


~Trent
#329
Quote from: Shockbolt on Tue 31/03/2009 22:27:46
How should I go about handling one or any of them dropping an object/item to the ground or placing it anywhere in a room, and it'd still  have to be able to be picked up again?
Check out monkey's fancy RoomInv Module!

[Edit]: Gah! I was out of it yesterday... I copied that link to PM to Nickdude, apparently accidently pasted it here too.... Fixed now!

~Trent
#330
$1, I think you can run a while check inside a custom function. if (!null) sorta thing. Then have it return the highest number of the while loop (ie, the arrary size).

~Trent
#331
Quote from: Babar on Tue 31/03/2009 07:15:23
Yes, this is a waste of a post.
But apparently better than a waste of a thread.


~Trent
#332
Also, there are animated backgrounds (up to 5 frames I believe). You can then make objects (trees, other cars, etc) pass by using the Object.Move call and looping them once offscreen.

[Edit]: Assuming this is for a cutscene or something...

~Trent
#333
Quote from: Creed Malay on Mon 30/03/2009 22:57:49
Why did Hancock sign so big? Day of the Tentacle taught me that it was because he'd been told that "chicks dig a guy with a big... signature", but I am not totally convinced by that...
I was taught that he it was basically huge to openly prove his defiance against the King and that he was not timid in the least.

As for Baron's mystery person... I'm gonna go ahead and guess Hitler.


~Trent
#334
One, you messed up the quote tags in the previous post. No biggie.

Two, normal scripting commands can now be used in dialog scripts as of AGS 3.something. You simply need to indent the line.


~Trent
#335
Am I getting your question right?
QuoteThen the NPCs viewloop would change to something other than the previous
cSomeDude.ChangeView(int);
Quoteand the player will have lost the item from the inventory.
player.LoseInventory(iItem);


Another thing that can be useful is to actually give the item to SomeDude (SomeDude.AddInventory(iItem);) You can then use this as a global variable, rather than creating a SomeDudeHasItem variable.
To check, simply use  SomeDude.HasInventory(iItem) in an if statement.


~Trent
#336
As for cutscene two, if you already have the dialog and movements scripted. That's what AGS cutscenes are. The only thing to add would be StartCutscene() and EndCutscene(), which allow the play to skip them. (Like if they've played the game before).

*spot reserved for more posty-goodness*

~Trent
#337
The real issue is 8 year old playing those games. But most of the teens that say "I shot him cause I saw it in GTA" are messed up in the first place and it has nothing to do with video games.

@SpacePaw--I totally get what you mean.

And finally, I don't care what ramifications it may have to my psyche, who doesn't have fun getting chased by the cops across Liberty City?!

~Trent
#338
Critics' Lounge / Re: Carousel Poster
Mon 30/03/2009 08:42:28
Quote from: SpacePaw on Tue 24/03/2009 11:35:28
Or make it a little bit bigger and put it INSTEAD of 'O'
No. That rarely works, and especially not for an advertisement for the show Carousel.

But I do somewhat agree with Progz that the moon seems out of place. I think it might benefit from being placed higher in the sky (ie. out of frame, and moving it's reflection downward).

Otherwise I think it looks great, being a performer, theater-goer, and techie myself.


[Edit]: I'd remove the 2009 from the dates. Not that that's bad to have, but when you already have a list of numbers....
Also, there's no time listed. I assume it's 7:00 or so, but that's something I strongly suggest adding (although not always needed)

~Trent
#339
I know everybody here has read Eric tuts, but why not use blurred motion?



~Trent
#340
Critics' Lounge / Re: angry head
Mon 30/03/2009 08:25:45
For this character, I think the hair looks fine. But I can see where you would want to practice... just start pulling up some ref pictures.


~Trent
SMF spam blocked by CleanTalk