Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: InCreator on Tue 21/10/2003 01:29:21

Title: And a very simple yet useful suggestion/request
Post by: InCreator on Tue 21/10/2003 01:29:21
character[CHARID].visible

Didn't find it from global variables! No such thing?
Or I just searched badly?

It can be done by changing character's view for a empty frame, but such variable could do things alot easier. Especially needed when character is inside something - so he's not visible and just his speech w/color is needed (such as in a car, starship, house, behind a locked door, etc)
Title: Re:And a very simple yet useful suggestion/request
Post by: RickJ on Tue 21/10/2003 01:36:55
You can do a character[CHARID].room = -1 to make him dissapear, I believe.   It's not exactly the same thing though...

Doesn't work if you want him to wander around the current room as an invisible guy.
Title: Re:And a very simple yet useful suggestion/request
Post by: Ishmael on Tue 21/10/2003 04:59:44
SetCharacterTrasnparency, but I have some not so good memories of trying it once...
Title: Re:And a very simple yet useful suggestion/request
Post by: Gilbert on Tue 21/10/2003 05:13:50
Setting the room to -1 may cause problem if the character in question is the current player character.

SetCharacterTransparency() won't work for 256 colour games.

Using a view with transparent sprite is the way to go.

Anyway, I think a Hide(Show)Character(0 functions can be good for more readible scriptings, better management of views and the like (Using an ordinary variable may require the engine to check it every game loop, which may not be really practical), as there are Hide(Show)MouseCursor() functions already (though I understand that for cursors it may use some of the mouse driver functions, making their implementation without any pain), unless there're so many troubles with it.

Title: Re:And a very simple yet useful suggestion/request
Post by: InCreator on Tue 21/10/2003 06:11:59
Right. But I usually need invisible guy to TALK and this means already messing up 2 Views. And after invisible stuff I must change them back... oh god.
Title: Re:And a very simple yet useful suggestion/request
Post by: MrColossal on Tue 21/10/2003 06:27:19
if you move a character to room -1 you can still have him talk and it talks from whatever coordinate he was last in
Title: Re:And a very simple yet useful suggestion/request
Post by: Gilbert on Tue 21/10/2003 06:30:05
Yeah right, but may not be good if it's the player character. It's completely okay for nonplayer characters.
Title: Re:And a very simple yet useful suggestion/request
Post by: Ishmael on Tue 21/10/2003 11:25:14
AFAIK, the player character can be in diffrent room then the game is, as long as no MoveCharacter or similiar functions are run.
Title: Re:And a very simple yet useful suggestion/request
Post by: Pumaman on Tue 21/10/2003 20:39:21
There is an undocumented  character[CHARID].on   variable, which is normally 1, but you can set it to 0 to make the character invisible.

It's not officially supported though and I'm not sure if it still works properly, but it might do what you need.
Title: Re:And a very simple yet useful suggestion/request
Post by: DoorKnobHandle on Tue 21/10/2003 20:41:24
My (dirty) solution:

In the time, the player is supposed to be invisible, just change the player's view to a view with transparent sprites only!


Simple, dirty hack, but working - SO WhAT!
Title: Re:And a very simple yet useful suggestion/request
Post by: Scorpiorus on Tue 21/10/2003 21:38:08
Quote from: Pumaman on Tue 21/10/2003 20:39:21
There is an undocumented  character[CHARID].on   variable, which is normally 1, but you can set it to 0 to make the character invisible.

It's not officially supported though and I'm not sure if it still works properly, but it might do what you need.
hehe, let me go to check AGS plugin interface header to find more undocumented variables... ;D
Title: Re:And a very simple yet useful suggestion/request
Post by: Ishmael on Wed 22/10/2003 05:13:14
QuoteIt can be done by changing character's view for a empty frame, but such variable could do things alot easier.
QuoteIn the time, the player is supposed to be invisible, just change the player's view to a view with transparent sprites only!

Don't these mean the same, or am I going insane?
Title: Re:And a very simple yet useful suggestion/request
Post by: InCreator on Wed 22/10/2003 09:42:51
IT IS the same. Mamarulez just didn't read this thread before posting.
Title: Re:And a very simple yet useful suggestion/request
Post by: Ishmael on Wed 22/10/2003 11:17:46
I forgot to add a ;D:P in that post.....
Title: Re:And a very simple yet useful suggestion/request
Post by: TerranRich on Wed 22/10/2003 21:36:17
And why won't SetCharacterTransparency() work exactly?
Title: Re:And a very simple yet useful suggestion/request
Post by: Scorpiorus on Wed 22/10/2003 21:45:06
Quote from: terranRICH on Wed 22/10/2003 21:36:17
And why won't SetCharacterTransparency() work exactly?
not for 256-color game


EDIT: just checked. seems like it works for 100%ttransparency level:

SetCharacterTransparency(EGO, 100);
:)

~Cheers
Title: Re:And a very simple yet useful suggestion/request
Post by: InCreator on Wed 22/10/2003 23:02:15
Doesn't it slow things down?

Ah, hell. As I said, we need
character[CHARID].visible
and that's it.