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

#1
I have a similar problem when I debug a 800x600 AGS game I'm making. It'll freeze the game's screen, but it will flash between it and the current screen. It happens when my laptop is unplugged as well.


~Trent
#2
The most basic way to handle this is to set the player character to the dummy, but this can have ramifications such as changing the room, but can also be easily worked around. A very easily solution is to use the same view for both characters.

Guy: InvWindow.GetAt can be done with GUIControl.GetAt and .AsType. You could even script and extender if you plan on using it often.



~Trent
#3
Terran, I like your idea of using .Say and .Speaking. I probably would've suggested overlays as well, but you are such a genius!

~Trent
#4
Then read the instructions of use in the module's manual (usual contained in the module's script header, so that you can read it in AGS)

~Trent
#5
I've never used DisplayAt, but you can best solve your problem with this:
Code: ags
DateTime *dt = DateTime.Now;
String time=String.Format("The time is: %02d:%02d:%02d", dt.Hour, dt.Minute, dt.Second)
DisplayAt (700, 400, 370, time);


As for your other questions, I don't have time right now to answer, but someone else will, or you can check out the Scripting tutorial in the manual.


~Trent
#6
You can only do that when the parameter is a const string like in .Say, so for SayBackground use
Code: ags

    cChar1.SayBackground(String.Format("try %d", tries));

Slightly confusing, but easy to solve.


[Edit]: So I might be wrong about the const string thing... but I  know it's related. Either way, String.Format will solve your problem.


~Trent
#7
But as in the thread Tosh linked, many of the links are recently broken because of BfS is down. When that gets back up, or a replacement, I think a proactive link fixing operation can be done (especially in prep for a new design)


~Trent
#8
I'm agreed with you Snake, ClaimEvent wasn't part of my scripting vocab for a long time. My favorite use of it is actually with the on_event rather than key_press or mouse_click.

Question to the scripting masters: What functions will it actually claim? The manual mentions only key_press and mouse_click, but I'm guessing that it works for all functions listed on that page, right?



~Trent
#9
Put the lines Guy has pointed out in the room_leave scripts of the last rooms that are 'followable'.

For example, say a wolf is following Little Red Riding Hood through the woods. Once she gets inside the house, she won't be followed anymore. So in the room outside the house, put cWolf.FollowCharacter(null) in the room_leave script. You may also want to put a cWolf.FollowCharacer(player) in the room_afterfadein so that when you come back to the room.....


If you have to do this with a large number of rooms, I suggest reading up on Custom Properties and the on_event function. It's not hard scripting, but we're here to answer questions you may have about it.



~Trent
#10
Saw it today and it absolutely blew me away. Loved it through and through.

Personally, I feel the movie did an excellent job of incorporating the Star Trek shows into it. It didn't retcon, but rather allowed both to exist and still tell its own story. And I've never liked Star Trek, but I knew enough characters to enjoy it--which a original sci-fi could not do.


~Trent
#11
I beg to differ.

Quote from: shaungaryevans on Sat 23/05/2009 22:47:08
Hi,

Can I deactivate a key then activate it later on in the game?

Quote from: shaungaryevans on Sat 23/05/2009 21:06:12
Can I deactivate a key then activate it later on in the game?



~Trent
#12
Haven't you asked this twice before?

~Trent
#13
@Jp: Hahaha, you linked a thread where I quoted Dualnames from this very thread!

@CJ: Woohoo-Curry! DLing now.

@Dave: Glad to help, but did you see Pumaman's reply to your question? It's smack in the middle of his big post above.


~Trent
#14
You can also use Custom Properties in conjunction with this to do some powerful stuff.


Quote from: Xenogia on Wed 10/06/2009 06:04:15
I checked for something modulised but couldn't find anything.
I must be crazy then. Oh well.


~Trent
#15
Quote from: Vera on Wed 10/06/2009 05:48:22
That gives me the error saying I can't use the change room command within non-blocking events such as the repeatedly_execute_always one.
A-hah. Well, I didn't have the manual in front of me at the time... but Christian has come and save the day.


~Trent
#16
Ways to use your existing code:
1) Add an else if to the second if statement (like Guy's first block of code)
2) Remove the second if and replace it with an else (like Guy's second block of code)
3) Add a return command at the end of the first if statement, which terminates the rest of the script

Also, the only time you need to use the object[] array is in the global script. Otherwise, you can just use it's script name (oespelho).

Another thing of mention, you can format sections of code (like above) by putting it between [ code ] [ /code ] brackets (minus the spaces).


~Trent
#17
I'm thinking that your Wait(4) for 120 loops may be blocking the keypresses. Try adding this to your room:

Code: ags
function repeatedly_execute_always() {  //the always means that this runs even during blocking events
  if (IsKeyPressed(eKeyReturn)) {
    player.ChangeRoom (2, 130, 120);
  }
}


Not sure, but try it.
[Edit]:Oops, that's what I get from being lazy and copy-pasting.
~Trent
#18
Glad to help. Besides, it's good for everybody (not just the OP) to discuss other ways of solving problems. Makes you a better scripter.


~Trent
#19
mouse.Mode=eModePointer;


~Trent
#20
There was a recent thread dealing with moving the character on screen instantaneously (solution being to change the xy values directly) in which someone suggested using ChangeRoom to the same room. Perhaps that would fix your second problem?


~Trent
SMF spam blocked by CleanTalk