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

#81
Quote from: Crimson Wizard on Tue 06/10/2015 15:48:12
I think it should not redraw cursor if the graphic is the same.

That's sort of what I thought. Why redraw 40 times a second?
But then again, Slasher is right, I didn't try it yet (stuck at the office and too eager to wait until I get home :grin:)
#82
If this is put into repeatedly_execute, won't it give performance issues, like a blinking mouse cursor, when the mouse mode updates 40 times a second?

#83
I'm toying with the idea of adding a feature to my pet project.

It's Sierra-style, but instead of the usual walk-look-use-talk icons rotating by right click, I'd like to make the cursor change into the appropriate mouse.Mode when the mouse is moved onto a select hotspot.

This is very easy using the "Mouse moves over hotspot" event for a hotspot. Then, using the "Any click on hotspot" event, I can execute a command that's appropriate for the particular hotspot.

However, this only works one way. The mouse moves over the hotspot and the cursor changes. I'd like the cursor to change back to default once the mouse moves away from the hotspot again.

I have the feeling this might be accomplished easily using and "if" in repeatedly_execute and mouse.UseDefaultGraphic, but I need to tell the script what event to look for, i.e. something like this in the main script:

Code: ags

function repeatedly_execute()
{
    if (OnTheEventOfTheMouseLeavingAHotspot)
  {
  mouse.UseDefaultGraphic;
  }
}


Now, typing OnTheEventOfTheMouseLeavingAHotspot is rather silly of course, but what should I type in its stead?

#84
Thanks for your help, I'll take a look at what F12 does in the template and the SaveScreenShot() feature.

It's not for a game, though. I'm trying to make a simple data input interface that allows users to fill in an application form and print it onto a piece of paper. I could probably use any number of other platforms for this, but I'd like to try it out in AGS.

#85
Is there a function in AGS to print the current game screen?
I'm toying with the idea of typing in some data in a parser, process the data and pop them into a certain visual presentation, whichcan then be printed. I think I can manage the rest, but before I spend the time on it I need to know if it's feasible to print the end product from the game screen.
If so, perhaps it is even possible to print directly into a pdf file? (Otherwise I'll simply use pdfcreator, just wondering if it might be integrated in AGS already)
#86
My deepest apologies. I have just discovered I was testing different size sprites in view 2 whereas the characters current view was view 4  (roll).

Meaning I have been on a wild goose chase all along. And all my own fault :P.

Again, apologies for wasting your time, all.
#87
But that is what's so strange.


when testing this in a new game (created from template), the above integers and function works fine.

I just cannnot get the same thing to work in my game. It might be because cEgo has multiple views? cEgo has a normal walking view, but for this occasion, changes view with Change.View, into his "confrontation with cEnemy"-view.

Anyway, what happens is this; cEgo is a sprite 80 pixels wide (in his "confrontation" view). cEnemy is a sprite 28 pixels wide.
The function that [does something] and is placed in room_repexec is triggered just prior to when I would expect. The leftmost pixel of cEgo is three or four pixels away from the leftmost pixel of cEnemy. If I change cEgo's size to 60 pixels wide and set int cEgoLeftmost = player.x-30, then the problem is even greater; the function is triggered some 10-12 pixels prior to the two leftmost pixels meeting.

What can be causing this?

#88
Wait, I need to get to the bottom of this. It kills me to have something that should be so simple mess up  :-X

What, exactly, defines a characters x-location?

Is it the characters normal view or his current view?
And is it the largest frame that is used in the characters view, or frame 0 of the view, or what is it?

Does Change.View affect where player.x is?



#89
EDIT: After I wrote the message beneath, I started over from scratch and tested things in a "clean" environment with big squares for character sprites. It works. Too much clutter-up in my test game, I guess :-D



********************************

Not entirely solved yet, I'm afraid. There is a puzzling issue :confused:

What I'm trying to do is determine if two characters come close enough to trigger a function, which I set up for the occasion.

For testing purposes, I use one character, cEgo, who is 80 pixels wide. Another character, cEnemy, is 28 pixels wide.

I have defined integers of cEgoLeftmost and cEnemyLeftmost in global script.

In room script I have:
Code: ags

function room_RepExec()
{
cEgoLeftmost = player.x-40;
cEnemyLeftmost = cEnemy.x-14;

if (cEnemyLeftmost-cEgoLeftmost < 1)
  {
    [Do something]
  }
}


In game, I make cEgo walk from the left side of the screen to the right side of the screen and see when [Do something] reacts. I'd expect that to be at the exact time when the leftmost pixel of cEgo walks past the leftmost pixel of cEnemy.

However, [Do something] happens about three to four pixels BEFORE their leftmost pixels actually meet.

Any idea how come cEgo triggers the reaction before his Leftmost pixel has passed his enemys Leftmost pixel?


#90
The .z property? That sounds interesting, what is it?

Also, let me be sure I get this right:
If a sprite is 28 pixels wide, the player.x property will be at... the x location of the leftmost pixel plus 13?


EDIT: Please ignore my last question. I can work with it as it is. Thank you very much!
#91
Where, exactly, are player.x and player.y, relative to what I can see of the character sprite on the screen?

EDIT: Alternatively, where are player.x and player.y relative to the edge of the actual sprite, even if part of the sprite is not visible?

#92
Quote from: Baron on Wed 14/01/2015 00:07:49
On a plus note: BATTLE PIG!! :=  So I guess it all roughly balances out. :P

I agree. While much of the added elements were plain tiresome, on the other side little gems such as the battlepig, and Dain's speech, certainly lights up (laugh).
One could have wished for Jackson to concentrate more of his efforts to bring such charming and light-hearted elements into the movie.

Oh, and the point of Bard knowing of Smaug's weak spot because of the bird telling him. I really missed that.
#93
i'll have to give this a few try-outs, I guess. Thank you for your suggestions everyone.
#94
Slasher, I  haven't tried out your code yet, but I am a bit confused as to why you set cConrad's LOOP to 1 or 2, I would expect his VIEW to be the key?

#95
Weeell, both solutions are of course simple and straightforward enough. Only I was hoping for something that would let me avoid doing that by instead using a not-so-custommade piece of coding  :-D

Anyway, It's back to the drawing board for me ;)
#96
Is there a way to make a character walk backwards? That is, keep his current view, but reverse his direction and animation.
#97
Possibly, if the character is standing on a non-walkable area, and the walk cursor is clicked anywhere, the character should begin to walk, then immediately stop, since he is, after all, standing on a non-walkable...?

I have no working idea as to a solution, though, sorry.
You might want to turn the character "off" and instead use an animated object that looks exactly the same.
#98
Quote from: selmiak on Fri 16/01/2015 15:07:48
now it's getting really cryptic... ;-D
Sorry for being needlessly cryptic :D   I just wanted to point out that sometimes it is simpler (though in the longer run more tiresome and bug-prone) to think all logical possibilities through then write it all in code, instead of looking for some specific function that does it. Like Adazalya does when he/she simply writes specific coordinates instead of using player.x, player.y. Personally, I had to write myself through a lot of code with a lot of integers that looked (almost) exactly the same, before I could appreciate the point of using arrays    :D
#99
Quote from: Adazalya on Thu 15/01/2015 10:26:26
Oh ineed ! Thank you haha :-D I often think to complicated things before simple ones

Sometimes, complicated solutions are simpler than simple solutions. I do that a lot ;)
#100
you might still want to set the baddys walk coordinates to player.x, player.y. That will save you some of your code.
SMF spam blocked by CleanTalk