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

#2981
Also, why have you used so many 'if (character[GetPlayerCharacter()].inv[1] > 0)' lines? Surely you could condense them down to one:

if (character[GetPlayerCharacter()].inv[1] > 0) {Ã, 
Ã,  DisplaySpeech(JER, "GIVE MESSAGE");
Ã,  FollowCharacter(1, -1);
Ã,  SetCharacterView (FISH, 5);
Ã,  AnimateCharacter (FISH, loop, delay, repeat);
Ã,  ReleaseCharacterView(FISH);
Ã,  LoseInventory(1);
}
else if (character[GetPlayerCharacter()].inv[1] == 0) {
Ã,  DisplaySpeech(JER, "NO GIVE MESSAGE");
}
#2983
Danged GeoCities. Try this one:
http://www.geocities.com/WhoIsMonkey/Scroller.zip
(Right Click, and 'Save Target As...')
#2984
Why is it not working? Or, rather, HOW, is it not working? What is happening, what isn't happening?

The scripting I gave you works fine for me, I'm confused that it doesn't for you.

EDIT:
Link deleted
#2985
Firstly, you'll need to add the last 400 pixel from the right of your room on to the left, and the first 400 pixels from the left onto the right. Something like this, without the pink lines:
http://www.geocities.com/whoismonkey/scrollbg.png
(Use 'Save Target As...', due to GeoCities)

Then, change the scrolling code to:

if (mouse.x < 20) {
Ã,  if (GetViewportX() > 0) SetViewport (GetViewportX() - 5, GetViewportY());
Ã,  if (GetViewportX() == 0) SetViewport (768, GetViewportY());
}
Ã, 
if (mouse.x > 380) {
Ã,  if (GetViewportX() < 768) SetViewport (GetViewportX() + 5, GetViewportY());
Ã,  if (GetViewportX() == 768) SetViewport (0, GetViewportY());
}

Hopefully, this'll scroll the screen in a nice, smooth loop (apart from any characters / objects in the overlap, which you'll have to double up). Works for me, anyway.

To scroll walking characters, I think you have to:
Ã,  Ã, 1. Set the screen transition to Instant (since you say this is probably going to be a 1 room game, just do it on the settings window).
Ã,  Ã, 2. Set the left screen edge to 200 pixels in, and make the interaction NewRoomEx (ROOM, 767, player.y);
Ã,  Ã, 3. Set the rightt screen edge to 768 pixels in, and make the interaction NewRoomEx (ROOM, 201, player.y);
HOWEVER, I'm not totally sure on this, so you might want to look this bit up somewhere else.
#2986
I think you only need one =, so:

         if (character[1].inv[26] =1) {
            SetDialogOption (2,8,1);
          }

Or, put the SetDialogOption (2,8,0); in the same place you pick up the inventory item.
#2987
Or, you could use the character[].walking variable, e.g.

In rep_ex of the room:
if (character[LIGHT].walking == 0) {
  MoveCharacter (LIGHT, character[LIGHT].x, 180);
  MoveCharacterPath (LIGHT, character[LIGHT].x, 20);
}

This will check if the light is moving, and as soon as it stops will set it moving again.
#2988
About the walkbehind:
SetCharacterIgnoreWalkbehinds tells the character to igonre ALL walkbehinds, not just a specific one, which seem to be what you want. Perhaps you could use SetWalkBehindBase to 'turn off' the walkbehind you want?
#2989
if (mouse.y < 20) if (GetViewportY() > 0) SetViewport (GetViewportX(), GetViewportY()-5);
if (mouse.y > 280) SetViewport (GetViewportX(), GetViewportY()+5);

NOTE: changed 20 pixel movement to 5 pixels - I thought it was a bit too fast before.

But, if you have a pop-up GUI at the top of the screen (like the ICONBAR GUI the default game has) there could be some confusion, as the screen will scroll up when ever you try to access the GUI.
#2990
Ultimo:
Actually, the if / else if statements where meant to be in the same script parts, as they both need to be checked for the mouse.x condition. The longer version would be:

if (mouse.x < 20) {
Ã,  if (GetViewportX() > 0) {
Ã,  Ã,  SetViewport (GetViewportX() - 20, GetViewportY());
Ã,  }
Ã,  else if (GetViewPortX() == 0) {
Ã,  Ã,  SetViewport (ROOMWIDTH-320, GetViewportY());
Ã,  }
}

or, the second line could just be 'else', not 'else if'.

Haddas:
It works fine for me, if a little fast. Like Ultimo said, which line is the problem?
Also, although you probably caught this yourself, you need to replace ROOMWIDTH - 320 with the amount needed - SetViewport (448, GetViewportY()); for the image you're using -Ã,  and ROOMWIDTH with the width of the room - in this case 768, unless you resize the image
#2991
The scrolling part is fairly easy, I think:

in rep_ex:
  if (mouse.x < 20) SetViewport (GetViewportX() - 20, GetViewportY());
  if (mouse.x > 300) SetViewport (GetViewportX() + 20, GetViewportY());

The looping part I'm not so sure of.

if (mouse.x < 20) {
  if (GetViewportX() > 0) SetViewport (GetViewportX() - 20, GetViewportY());
  else if (GetViewPortX() == 0) SetViewport (ROOMWIDTH-320, GetViewportY());
}
if (mouse.x > 300) {
  if (GetViewportX() < ROOMWIDTH) SetViewport (GetViewportX() + 20, GetViewportY());
  else if (GetViewPortX() == ROOMWIDTH) SetViewport (0, GetViewportY());
}

This works, but there's a noticable 'jump' when it changes location. Pasting extra image in, like on a normal looping room, would probably sort that out.

Hope this helps.
#2992
Look up Voice Speech (in the 'Music and Sound' section of the manual).

EDIT:
To have sound only, use
SetVoiceMode (2);

I wouldn't recommend this for default, though, for a couple of reasons (file size, and some people not having speakers, for example).
#2993
What did you make the avi in? Could it be a problem with the codecs?
#2994
AFAIK, game templates (.agt files) should work when they're put into the AGS folder (C:\AGS for example), while exported GUI's (.gui files) need to be imported using the 'Import GUIs..' button on the GUI editor. Which type are you trying to use?

EDIT: Ok, I see the problem. That zip doesn't actually contain a template, just the game files. Extract it, open it in AGS, and choose 'Make template from this game..' from the Game options. Now you should be able to create new games using the verbcoin.
#2995
SetGlobalInt (100, GetGlobalInt(100)+1);
#2996
I couldn't find the ascii code for the + and - keys, so I had to improvise. If you're not using the up and down arrows for anything (or the left-right ones), they might be a better choice.

In Global Script, outside any function:
int txtspd;

In repeatedly_execute:
game.text_speed = txtspd;

In on_key_press:
  if ((keycode==381) && (txtspd > 0)) txtspd --;  //PgDn decreases speed, unless speed is 0
  if (keycode==379) txtspd ++;  //End increases speed

This way, speed can be changed at any point during game. If you want it to be done on an options GUI type thing, skip the on_key_press, use a Slider on the GUI, and make it:

game.text_speed = GetSliderValue (OPTIONS, SLIDER);

Hope this helps.
#2997
If it doesn't work, try splitting it up:

Player enters room (before fadein):
  SetCharacterSpeechView(EGO, 6);

Player enters room (before fadein):
  StartCutscene(1);
  AnimateCharacter(EGO, 4, 4, 999);
  SetCharacterSpeechView(EGO, 4);
  EndCutscene();

Also, I don't think 999 is a valid amount, the repeat variable can only be 1 or 0.
#2998
Couldn't you just create them as custom functions?
So, in the global script you'd have something like:

function GrabHead(); {
  SetCharacterView (EGO, GRABVIEW);
  AnimateCharacter (EGO, 0, 3, 0);
  SetCharacterView (EGO, NORMALVIEW);
}

Then in the Script Header:

import function GrabHead();

I've done something similar to automate NPC inventories.
#2999
string buffer;
GetCharacterPropertyText(EGO, "Property", buffer);
SetLabelText(GUI, LABEL, buffer);

(Obviously set what chracter, property, GUI and LABEL you want).

As for where you put it, that would depend how you want it to behave.
#3000
I guess UsedMode() is a custom function? But shouldn't it be:

if (UsedMode() == open) {

Maybe GetCursorMode() would work, if you've actually created a MODE_OPEN.
SMF spam blocked by CleanTalk