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

#1
I don't know much about it, but prefixing variables only with '_' isn't all that safe, as it's for reserved identifiers, same goes for '__' (double underscores).
#2
If you are indeed doing oWhatEver.Solid = true, try changing the BlockingHeight and BlockingWidth properties of the object. These defines the size of the area that the object is blocking, and if the couch is a large object, you probably only need to increase those.
#3
WARNING: This is code is untested

Make regions as the hills top and bottom. In their "player walks onto" function, turn on/off the walkbehind, adjust the scaling of the walkable area, and tell the game if the movement sould be inverted or not. This is how I think it should be done.

Have some variables to keep track of which hill we're on, if the mouse is inverted, and if the walkbehind is active.
Code: ags

bool _invertedWalk; // Is the movement inverted
bool _onFarHill; // Are we on the far away hill
bool _walkbehindOn // Keep track if the walkable area is active


This is how I invert the mouse (same idea as my first post)
Code: ags

// PLACE THIS INSIDE THE ROOM SCRIPT
function on_mouse_click(MouseButton button)
{
  // Rooms can have their own on_mouse_click function too
  if (_invertedWalk && mouse.Mode == eModeWalkTo)
  {
    int invertY = ROOM_HEIGHT - mouse.y;
    ProcessClick(mouse.x, invertY, eModeWalkTo);
    ClaimEvent(); // Prevent global on_mouse_click to get run.
  }
}


This is the "walks onto" function for the first hills top.
Code: ags

WalkOntoHillTop // Should be the "walks onto" function for the region that is the hill top
{
  // If the player is on the far away hill, this region does nothing
  if (_onFarHill)
    return;

  // We are on the fist hill, figure out if we're walking to the back or front of it.
  if (!_walkbehindOn)
  {
    // Walk to the back of the fist hill
    SetWalkBehindBase(THE_ID_OF_THE_WALKBEHIND_YOU_USE, HEIGHT_OF_YOUR_ROOM);
    _walkbehindOn = true;

    // Whe sould invert the walk. So if we click at the bottom of the front hill, the character will walk upp the back
    // then down the front.
    // If we click the backgroun hill, the player should walk down the first hill, then up the second.
    _invertedWalk = true;
  }
  else
  {
     // Walk to the front of the fist hill
    SetWalkBehindBase(THE_ID_OF_THE_WALKBEHIND_YOU_USE, 0);
    _walkbehindOn = false;

    // Reset movement to normal
    _invertedWalk = false;
  }

  // Since the player is at the top of the hill, he should start walking down.
  // So get the distance that he have left to walk.
  int dist = player.y - mouse.y;

  // Have the player walk down that last bit
  ProcessClick(mouse.x, player.y + dist, eModeWalkTo);
}


The second region should do the same. Check wich hill we're on, check if we're behind of infront of it. Check where we are going, and based of all that, change our direction, scale, and so forth if needed.

As I said, this code is untested. I've ony did a quick test of my idea, but it was not as neatly done as this.
I don't want to get in to the off-topic discussion, but seriously, use regions for this kind of stuff, it's what they're made for ::)
#4
Add an on_mouse_click() function in the room script. In that check if the player is trying to walk while his on the region. If he is, call processClick with the inverted mouse co-ordinates.

To invert the co-ordinates just substract them from the screens height and width.
Say if your game is made in 320x200 resolution. Then, the inverted co-ordinates will be:
Code: ags

ProcessClick(320 - mouse.x, 200 - mouse.y, eModeWalktTo);

#5
You could use DrawingSurface.GetPixel, and based on the result you set the gui to non-clickable, process the click again, and reset the gui to clickable.
#6
Search the forums.
Then you will see that this question have been asked many times before ;)
#7
Change the last parameter of
Code: ags
EffectsSpriteCombined = DynamicSprite.Create(640, 480, true);
to false. Alpha channels in dynamic sprites is a bit wierd.

This is how I think it works (anyone, please correct me if I'm wrong):
When we create a dynamic sprite with an alpha channel, it's alpha is set to 0. When something is drawn to the image, it will be drawn with an alpha at 0 (fully transparent) since AGS doesn't seem to take the images alpha channels into account, and just use the alpha of the image we're drawing on to.
#8
Right, it's Moving, not walking. I've been messing around with plugins a bit too much latley :P
#9
I did a quick test and it appears that walking or talking does not set player.Animating to true. So you just need to add some extra checks at the beginning, like player.Walking and player.Speaking

[edit] typo
#10
You could set a variable to indicate when Nancy is gazing and check the variable in on_mouse_click. Then simply call UnlockView if she is and reset the variable.
#11
As mode7 said:
Quote
This will load all your sprites which have been assigned to views into memory (well only the first 3000 of them - this is an arbitrary number and if you have more it will probably crash).
However these are loaded into a dynamic sprites so I dont think it will actually affect other instances. Try it anyway

So just increase the array limit to a minimum of 3436. And make sure you call Delete() on all the dynamic sprites before quitting the game.

If just loading the frames to dynamic sprites doesn't help, you can overwrite the Graphic property of the ViewFrame* to point to the dynamic sprite. But be careful, this means you'll have to keep the sprite in memory as long as you want to be able use the views.
#12
QuoteThis code doesn't work with default "dialog branches" system

Well, I got it to work with AGS dialogs on my end, but I only tried it in a simple dialog, one initial with one sub-dialog, but I don't see how it will fail in a more complex setup. But maybe I'm just missing the point entierly since I haven't worked that much with complicated dialogs.
#13
This is how I do it

Simply set up all the gui elements (a button and a label) on a gui and change all the #define in the begining of the script. Then use charachter.Speak instead of say:

player.Speak("hello");
or
player.Speak("hello", 0, true);

0 is the loop of the characters think view, and the bool determens if the will text be append to already written text.

The text will be written letter by letter, and can be skipped with space or the left mouse button. And it works with the default dialog system.
#14
I've done a similar system to what you're trying, and I've got a gui with a label and two buttons for the characters speaking (as I have the both the player and NPC in closeup).

I have a custom speech function that starts animating the appropriate button and writes text letter by letter to the lable. It's quite a lot of code, and might not be the best solution, but it do work.

It's been a while since I last touched it, but if you wan't I can clean it up and upload the script.
#15
General Discussion / Re: StarCraft anyone?
Fri 22/10/2010 12:12:52
I might just add you guys, since no one I know plays SC2.

And if someone else wants to add me - Dwaa #467
#16
Why I used a run-script instead of a custom function was due to this line in the manual:

"This command can only be used from within the dialog_request function"

but if this is incorrect, a custom function is a much better solution.
#17
You could replace the stop with a run-script command, and use StopDialog() in the dialog_request function.
#18
General Discussion / Re: StarCraft anyone?
Sat 19/06/2010 22:32:11
Too many dkh's :P
I'm LordHellabuse, maybe you got better luck in finding me.

[Edit]
Nevermind...
#19
General Discussion / Re: StarCraft anyone?
Sat 19/06/2010 21:58:04
Got gameranger myself, could PM you my id if you're interested in a game.
#20
General Discussion / Re: StarCraft anyone?
Sat 19/06/2010 14:08:25
Is there still any interest in this?
For some reason I got a real urge to start playing this again.
SMF spam blocked by CleanTalk