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 - Héctor Bometón

#21
Quote from: Crimson Wizard on Sun 26/07/2020 21:41:08
Cassiebsg, you probably confuse "drawing surface" and "dynamic sprite".

DrawingSurface can be deleted (by calling Release) freely as it's merely an interface to access some object. When you release Drawing Surface, the object stays changed. In fact, Releasing a surface is a must because with Direct3D and OpenGL renderers it signals to update the video texture.

Drawing on room background does not stay and gets lost when you leave the room. This is probably made intentionally, to not increase size of saved games.

The solution is to create a global DynamicSprite, draw on that sprite instead, and either assign that sprite to the room object, or paint that sprite to room background whenever player enters the room.
In your case things are little more complicated as, it seems, you can draw anywhere, so object will be inconvenient. Perhaps do this:
* create a global DynamicSprite.
* when entering a room, if that sprite already exists, then paste it on room background.
* when drawing, draw both on that sprite AND room background. Dynamic sprite will work as a reserved image for restoring room background later.

So... It's been a while, but I still haven't managed to make it work. I'm struggling understanding how to store and load/paste the previously drawn surface onto the Room when I enter. I understand the solution, but I'm currently not able to code it propoerly. could anyone be so kind to help me out with this? Thanks!
#22

Mmmm... Any easy way to check if the room is scrolling? I may have a workaround if I get to check that.
#23

It also happens when I try it in a room without any Viewport or Camera code at all. Just the default horizontal scrolling:

#24

I just used a duplicate of the player character (I use it for mirror effect) to try it and got the same result.

I also tried making the camera follow the character following the player, and then the player is the one who gets the jerkiness. I don't know if that sheds any light on the issue...

Code: ags
function late_repeatedly_execute_always()
{
  Game.Camera.SetAt(cMirror.x - 240, cMirror.y - 175);
}


#25

The cat's MovementSpeed is 5, and Animation Delay is 3.

I tried pairing those numbers, and also pairing the whole cat Movement parameters to the player's. Nothing.
#26
QuoteWhat do you mean controlling viewport manually? You mean Camera right? For ONLY setting the camera it's usually a good idea to use late_repeatedly_execute_always because then other movements are already updated. Also how are you moving the cat?

Well... I was using SetViewport because I was already comforable with that solution before the Cameras update came in and never bothered to switch. Now I just wiped out all mention to Viewport in that room script, and changed it for this:

Code: ags

function late_repeatedly_execute_always()
{
  Game.Camera.SetAt(player.x - 240, player.y - 175);
}


The result is the same. Just like the first video I shared.

How am I moving the cat?

Code: ags
cGato.FollowCharacter(player, 10, 10);


It also has a little code in repeatedly_execute_always to make him stand up when he stops walking, which I was pretty sure wasn't the problem, but I also tried without that code in case it was messing up the whole thing. It wasn't.

This problem reminds me of the jerkiness I got when first trying to achieve parallax for background and foreground objects. I solved it by setting the Viewport manually, so that way the viewport and the new position for the objects refreshed at the same time, and it worked, but not for this. I'm probably missing something...

QuoteIn the character tab, under the movement heading in the properties window is an option called "MovementLinkedToAnimation", set that to false.
That just made things wierder, and tweaking the speed doesn't make it better.

#27

Why does that happen? I'm controlling the viewport manually on this room, but it also happens in any other room with the default scrolling.

Is there anything I can do? (See video)

#28

Well, you can't draw "anywhere", only onto certain regions or hotspots, but I get it.

Never used Dynamic Sprites before, but I think I understood your explanation. I'll give it a try! Thank you very much!

#29

Sorry, didn't read your answer till now. Funnny enough, I'm already using your amazing SpeechBubble module in my game. Thank you very much!
#30
I managed to get the "freehand paint" (https://www.adventuregamestudio.co.uk/forums/index.php?topic=58278.0) working pretty well, as you can see in the following video. Now, the question is, can it be permanently visible or stored somewhere somehow? When I leave the room and come back, it's all gone.

I fear the answer is simpler than I think but I've been working so many hours... my brain just wont work properly...

#31
I know there is a  "game.text_shadow_color", but can you change the opacity?
#32
Once again: thank you!

I am amazed about how simple the code is!
#33

Ok, I want to take it further... What if I want to check if a certain area has being written on?

For example: I want to make a puzzel where you cross out a swastika gfraffiti. How could I know if x% of that region is covered with "paint"?
#34


Thank you! I understand the theory completely. I'm not so talented when it comes to code, but I'll try!
#35

By "shaking" I mean any repetitive back and forth movement (up-down, left-right ...).

For example, when the player has a "cocktail shaker" as active inventory, I want a sound (or an event) to be triggered when you "shake it" more than a couple of times.

Sorry for posting twice the same day! I don't mean to abuse your generostiy!
#36

Of course! Pretty obvious! I should stop and think a little before asking.

Thanks again!
#37

That was easy! Thank you very much.

Now I'm getting greedy... Would it be possible to specify which surfaces you can draw onto and which ones not? Like... Using regions or whatever?
#38
Is it possible to freehand draw with the mouse? Just like a pen/brush tool.

I have a blackboard on one of my backbrounds and I was wondering if I could make that "area" paintable when you use the chalk on it.

I can do without that, but it defiinitely would be funny!

Thank you!
#39
QuoteIs there a reason why you do not want to do so, or need to write texts directly in the script rather than in TRS file?

The reason is... I'm dumb.

Also, I was using a shitty font editor that wouldn't show me 256 characters, but only 128 (now I understand where all those "?" slots came from). I just found the right solution, which was usign a better font editor (https://www.adventuregamestudio.co.uk/forums/index.php?topic=48527.0) that allows me to use the latin characters without that stupid workaround I was doing...

Sorry and thank you!




#40
I need my fonts to have latin characters for its spanish translation. So long, I've managed to edit the font myself to add some of them, overwritting characters I wont need to be displayed as speech: (@ = á, { = é, ' = í, + = ó, < = ú). That way, if I need the player to say "Olé.", I would code: player.Say("Ol{.");

But I still need the capital vowels (Á, É, Í, Ã", Ú) and it seems like I still have plenty of space to insert these special characters, but I don't know how to type them.

So... How could I use all those "empty slots"? Which keys on the keyboard correspond to each of those? Hope I'm explaining myself...



SMF spam blocked by CleanTalk