resize player character

Started by SebastianEl, Thu 25/04/2024 13:45:44

Previous topic - Next topic

SebastianEl

Hi, new user here 🙂
Could you tell me how to resize player character? It's way too small after I've changed background image (it's higher res than starting template image) Thanks!

eri0o

In theory you should add images for the player character that are in compatible resolution.

If you are just prototyping you can set the character to manual scaling and set one scaling to it or adjust in the walkable area the scaling if you plan to have the character scaling depending on position.

RootBound

There are two ways to do this.

First, you can set the scaling of a walkable area in the room, using the area's properties panel. This can be a fixed scaling percentage or a continuous scaling (smaller at the top, larger at the bottom).

You can also scale the character manually by setting the character's "use room area scaling" property to false in the character properties panel. This can also be done in script by setting Character.ManualScaling to true and then setting Character.Scaling to whatever scaling percentage you want.

This would probably be done in the room_Load function but can be reset at any time.

See the manual here:
https://adventuregamestudio.github.io/ags-manual/Character.html#charactermanualscaling

https://adventuregamestudio.github.io/ags-manual/Character.html#characterscaling

https://adventuregamestudio.github.io/ags-manual/AdvancedRoomFeatures.html#character-scaling
They/them. Here are some of my games:

SebastianEl

Thak you for your responses! Unfortunatelly I'm completly green regarding coding, could you tell me where I made a  mistake? (NewScript.asc(2): Error (line 2): Parse error: unexpected 'cEgo')

Also..regardig the second error, I'm trying to setup a simple dialogue, hovever, I'm recieving this error: ... "scipt (...) has already finished", and no dialogue heppens...


Dialog 0(4): The command 'Cego: Hi!' will be ignored since the script for this option has already finished
Dialog 0(5): The command 'JC: HELLO' will be ignored since the script for this option has already finished
NewScript.asc(2): Error (line 2): Parse error: unexpected 'cEgo'




Thank you in advance, for the help! :)

glurex

I don't know what do you mean with "green", but it seems two different question. Maybe you should post another topic. In the Dialog system you have to write the character realname not the script name (cEgo), but maybe i'm not understanding your post.

Snarky

In general, it's difficult to tell what the problem is just from the error message without seeing the code.

Your errors might be because the commands haven't been placed inside a function. In AGS, all code (except code to declare variable types or create, export and import variables and functions) has to be inside a function (which in dialog scripts means under a label), because that tells the machine when it should run. Or it might be something else. If you post the code around the lines it complains about, we might be able to tell.

SebastianEl

@Snarky Hello, it's probably simple but can't fix it by myself: while adding dialogue


// Dialog script file
@S  // Dialog startup entry point
return
cEgo: Hi!
JC: HELLO
return


this error appears:

Dialog 0(4): The command 'Cego: Hi!' will be ignored since the script for this option has already finished
Dialog 0(5): The command 'JC: HELLO' will be ignored since the script for this option has already finished

I'll be happy to provide more info on this, if you'll specify where I can find it :) Thanks!!!



SebastianEl

@Snarky @glurex Oh, and real name is also: cEgo :) (it's a prototype)

@glurex By green I meant "new and unexperienced" :)

Khris

Re scaling:

Open the room, then click theāš”icon in the properties window. Now click the "player enters screen before fadein" event in the table, then click the [...] button at the end of the blank field.
This will create and link the function and take you to the room script. Now put the line inside the function so you have this:

Code: ags
function room_Load()
{
  player.ManualScaling = true;
  player.Scaling = 200;
}

As for the dialog script:
You don't need a dialog if you just want your characters to talk. You can simply put Say() lines in a function.
In a dialog, commands go after the entry points. So you'll want to create a first option, write "Hi!" inside, then check both the Say and Show boxes.
The script should look like this:

Code: ags
// Dialog script file
@S  // Dialog startup entry point
return
@1  // when first option is clicked, player says "Hi", then script runs from here
JC: HELLO
return

RootBound

@SebastianEl "return" will end each dialog option and go back to the start point, so it should stay at the end of each option. Just take that first "return" out and leave the second return in, and see if that works. When adding a new dialog option, you'll see AGS adds a return automatically. The dialog should go after the and before the return.

Here's the manual entry for a more detailed explanation:
https://adventuregamestudio.github.io/ags-manual/DialogScript.html

EDIT: looks like Khris beat me to it :P
They/them. Here are some of my games:

Khris

Quote from: RootBound on Fri 26/04/2024 12:00:36Just take that first "return" out

That first return is fine if you don't want anything to happen each time the dialog starts.

RootBound

Quote from: Khris on Fri 26/04/2024 12:02:12That first return is fine if you don't want anything to happen each time the dialog starts.

True, I was reading the hellos as coming before the options but I guess OP didn't specify that.
They/them. Here are some of my games:

SMF spam blocked by CleanTalk