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

#1061
Jade: You don't have to upload two versions of your background. You can display it resized using the height and width attributes:

Code: ags

[img width=639 height=473]http://i7.photobucket.com/albums/y281/jade03/Night.jpg[/img]


Excellent pic!
#1062
Those character script names have to be capitalized:
  character[TIMMY].Say("&1 Hi! How are you?");

But you can also use them directly:
  cTimmy.Say("&1 Hi! How are you?");
#1063
Also, check for = vs ==
#1064
In AGS v2.7, you can check if a GUI is enabled with the GUI.Visible property:

Code: ags

  if(gMy_gui.Visible == true) {


Quoteand MY_VAR with your integer variable...

Since labels can only display text strings, you have to convert your integer to a string first:

Code: ags

   string tempstr;
   StrFormat(tempstr, "%d", MY_VAR);
   SetLabelText ( MY_GUI, MY_LABELNR, tempstr);


In AGS v2.7, you give the label a name in the editor and just do
  mylabelname.SetText(tempstr);

-

If you're using a GlobalInt to store your health, you could also just set the label's text to @GIx@ where x is the number of the GlobalInt.
#1065
I've tested it in a default 256-color game and there was no flickering. Maybe some of your sprites are the wrong color depth or your views are set up wrong?
Perhaps there's something else in your rep_ex that messes with this?

Anyway, a few notes about your code:

Quote
    SetCharacterBaseline(SHADOW, character[EGO].y-1);

This should be put into the rep_ex function because any baseline other than 0 is not relative to the character's position. If you set it to a certain value, the baseline will be fixed at this height and not automatically be updated when the character moves.

Btw, to be fully AGS v2.7 compliant, you'd better use v2.7 code:
  cShadow.Baseline = cEgo.y - 1;

Quote
    SetCharacterTransparency (SHADOW, 50);

  cShadow.Transparency = 50;

Quote
    game.following_room_timer = 1;

Don't characters set to FOLLOW_EXACTLY enter the shepherd's room immediately anyway? I don't think you need this in this example.

Quote
    cShadow.LockView(SHADOWTEST);

The LockView function is supposed to be used before animating a character. Since your shadow character is using this view the whole time, better use the Character.ChangeView function or set the SHADOW character to the SHADOWTEST view in the editor and remove this line.

Quote
        cShadow.loop = cEgo.loop;
        cShadow.frame = cEgo.frame;

To make your code fully v2.7-compliant, you should use the capitalized properties .Loop and .Frame.

Quote
        cShadow.FollowCharacter(cEgo, FOLLOW_EXACTLY,  1);

There's no need to call this function every game loop. It is supposed to be executed once, AGS will take care of the rest.

So, in conclusion, a cleaned-up version of your code would be:

Code: ags

function game_start() {
    //...
 
    // Shadow setup
    cShadow.Transparency = 50;
    cShadow.FollowCharacter(cEgo, FOLLOW_EXACTLY,  1);
   
    //...
}


Code: ags

function repeatedly_execute_always() {
    //...

    // Shadow control
    // Is the player on a walkable area (i.e. in a normal, non-puzzle room)?
    if (GetWalkableAreaAt(cEgo.x, cEgo.y) != 0) {
        cShadow.Baseline = cEgo.y - 1;
        cShadow.Loop = cEgo.Loop;
        cShadow.Frame = cEgo.Frame;
    }
    else {
        // Use transparent loop to hide shadow
        cShadow.Loop = 8;
    }

    //...
}


Hope this helps.

Edit: Spelling
#1066
I guess the feature has been removed because if you changed the dialog option text, the dialog script comment would have to be updated too. In fact, there's still an outstanding tracker entry for that.
Perhaps CJ decided it just wasn't worth the trouble and removed them entirely?
#1067
Critics' Lounge / Re: Walking Cycle Tutorial
Thu 14/07/2005 14:16:42
Moved here from the Tech forum. Could a moderator please merge this with the Tutorials thread?
#1068
Version 0.81 now up:

  - Characters now play talking animation when talking*
  - Added check if character is .on before executing command
  - Renamed internal control command enums

See link above.

Edit:

*No lip-sync or voice speech though
#1069
Your idea was good, but to make it non-blocking, you have to decrease the volume from inside the repeatedly_execute function instead of a loop. Too lazy to code right now.
#1070
Quote from: rozojc on Thu 14/07/2005 01:08:58
Modification: maybe it's not because I don't have another background music in the second room, but I just read that it does not work if the music is in MIDI format (which it is)...

Yes, I had tested it with an mp3 file and it worked fine. Haven't worked with midi myself.
#1071
Quoteand obviously if I just use StopMusic() it stops abruptely.

To my knowledge, if you have "Crossfade music tracks" enabled in the General settings, the current music track fades out when using StopMusic().
#1072
Advanced Technical Forum / Re: mini-wishlist
Thu 14/07/2005 00:49:35
Please check the bug and suggestion tracker before making any suggestions. Almost anything you can think of has been suggested before.
#1073
The room script contains script for every event in this room. If you don't put the command in a function, how should AGS know when to execute it?

You first have to create the event function with the interaction editor.
Press the  "i" button, select when your command should be executed ("Player enters screen (before fadein)" for example), add a "Run script" action and press the "Edit script..." button. A window opens where you can put your command. Close and save.

Now press the "{}" button again and you will see that your command is encapsulated by the event function.
The "{}" button exists so you can quickly see and edit every script in this room and don't have to use the interaction editor every time to access the scripts.
#1075
Beginners' Technical Questions / Re: Last Room
Wed 13/07/2005 05:19:35
player.ChangeRoom(player.PreviousRoom);
#1077
BorisZ is right, your second question isn't directly related to AGS anymore. Continue the discussion in the General forum if you must.
#1078
QuoteBrilliant module. I've got it working now, but for some reason, when it displays the messages, the talking view doesn't play. Is this a known bug, or did I goober something up?

Yeah, it works exactly like SayBackground in that it just displays the text and doesn't play the talking animation. I might add this to the module at a later time.

Edit:

Version 0.81 now available.
#1080
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=11868.0

Edit:

It's also possible using my CharacterControl script module. Set up your text as, for example, global messages 512, 513 and 514, then do:
  CharacterControl.CreateChain(1, "SAYMSG:512; SAYMSG:513; SAYMSG:514;");
  CharacterControl.StartExecuting(cA, 1);

Or you could script it yourself using repeatedly_execute and timers and/or variables. I'm too lazy to code something right now.
SMF spam blocked by CleanTalk