Character transparency - Basic Scripting Help

Started by KANDYMAN-IAC, Wed 24/08/2016 03:40:20

Previous topic - Next topic

KANDYMAN-IAC

Guys, Girls, Non-binaries,

I AM GOING INSANE! Ok, I've got a conversation going on with a character behind a door, I placed them in the scene so that the position of the dialog text is correct. But trying to call the variables for the character to define visibility JUST AREN'T working... I've tried setting visibility = false I've tried setting transparency I am getting no where... I also attempted to scale the character smaller and hide them behind a nonwalkable area... nothing... nothing is affecting the fucking character, it remains...

Code: ags

function room_Load()
{
cEgo.Transparency = 100;
}  


My biggest problem is I don't understand when and how I define variables for characters. Or Functions for interactions, I get half of it, but my syntax is wrong. Is there a set of tutorials for the new engine that can help, the ones written directly by Chris on the main page don't give me enough understanding WHY certain phrases and pieces are called and used together... Are there any scripting tutorials that can help me understand the formatting and procedure to make some headway and context for programming in general?
"Don't lose the bluecups they may be our only hope....!!1!!!1"

"I'm jealous of all of you guys, which means. I love your work, I just hate you as a person.... wait thats not right."

Mandle

What colour option did you set for your game?

"NOTE: Transparency only works in 16-bit and 32-bit colour games."

KANDYMAN-IAC

Thank you Mandle. It's 256. So.... what are my other options to achieve the same result?

Also my question still stands. What should I do about coding... what tutorials and complete beginners guide do you recommend?
"Don't lose the bluecups they may be our only hope....!!1!!!1"

"I'm jealous of all of you guys, which means. I love your work, I just hate you as a person.... wait thats not right."

Scavenger

I believe you can use:

Code: ags

cEgo.on = false;


To hide characters in the same manner as objects.

Danvzare

Quote from: Scavenger on Wed 24/08/2016 05:46:30
I believe you can use:

Code: ags

cEgo.on = false;


To hide characters in the same manner as objects.
Woah, that's an actual function in the game engine?!? 8-0
I thought you could only do that to objects.
That will be useful in the future.

KANDYMAN-IAC

So how and where would I use that code? Do I call a function and then put it between the curly brackets?

This is my issue, I can look up necessary attributes in the manual, but I don't know how to connect them, or place them to be called or accessed. :/

(Last time I used AGS the Attribute editor was just being phased out >:( )
"Don't lose the bluecups they may be our only hope....!!1!!!1"

"I'm jealous of all of you guys, which means. I love your work, I just hate you as a person.... wait thats not right."

Slasher

#6
So, the character being spoken to is behind a door.... Why not make the door baseline large than the character so he is hidden behind it and not seen?

That's if I understand you correctly...

Learn stuff from wherever you can find it. The biggest learning curve is actually doing it..

You can define variables in the global variables pane in the editor, and in some cases in the global script.

You can call them from within your room scripts.. etc

Good luck


Khris

The question where to put code is the big one.

In general, AGS is event based. Which means whenever an event happens (player clicks "look at" cursor on inv item) the engine checks whether a script function is linked to the event and if so, calls it.
It also calls various built-in functions at various times (e.g. on_mouse_click), and to control what happens in the game, you fill those functions with code.

You already had the line in the proper place, namely in "room_Load", which is a function that is called after AGS loads the room, before the room is turned visible / faded in.
The code will run as long as you didn't just manually add that function to the script but also properly linked it (i.e. it also says "room_Load" in the room's event panel).

Code: ags
function room_Load()
{
  cEgo.on = false;
}

NickyNyce

#8
These videos are really helpful when you get started.

https://youtu.be/_lghOGrET2A

Cassiebsg

I would have just done like slasher suggested... but that's only cause I didn't know better. Now I do! :-D
There are those who believe that life here began out there...

dayowlron

There is so many ways to do this. all of the above can work or you can make the room larger than resolution and place the character off screen beyond what would show up based on walkable areas. I did that once before. I had walkable areas on the entire left side and across the bottom then placed a character I wanted in the room but not to show up on the screen in the upper right corner.
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell

Khris

#11
This is about being able to just let the other character .Say() stuff, without having to worry about where the text is going to appear. Moving them off screen means you can no longer use standard dialog scripts since you'd have to use SayAt().
(Also, you don't have to make the room bigger than the screen to be able to place characters off screen, setting their .y to -1 or -1000 is always fine, regardless of room size.)

slasher's solution is fine in principle, _if_ the door is either an object or a walkbehind.
Still, the simplest way is to not render the character in the first place.

KANDYMAN-IAC

Ugh... Khris, yeah I've been manually adding code cause I didn't/don't know how to add things through the editor. :(
"Don't lose the bluecups they may be our only hope....!!1!!!1"

"I'm jealous of all of you guys, which means. I love your work, I just hate you as a person.... wait thats not right."

KANDYMAN-IAC

"Don't lose the bluecups they may be our only hope....!!1!!!1"

"I'm jealous of all of you guys, which means. I love your work, I just hate you as a person.... wait thats not right."

Khris


SMF spam blocked by CleanTalk