Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Tue 05/08/2003 14:58:44

Title: !SetObject transparency!
Post by: on Tue 05/08/2003 14:58:44
Hi!

I have an object in the foreground (a branch), and the character can walk behind it and that works fine but, I have made four objects of the branch so that the three outer parts of it are transparent. The Fourth object is the furthest outer one and its most transparent then the object next to it less transparent and so on.

But I've scripted this but none of the objects are transparent:
(this is for room2)
// room script file

function game_start() {
 // called when the game starts, before the first room is loaded
 SetObjectTransparency(1,30);
  SetObjectTransparency(2,60);
  SetObjectTransparency(3,90);
}  

Is this completely wrong?

Please help and thanks!
Title: Re:!SetObject transparency!
Post by: SSH on Tue 05/08/2003 15:05:38
The problem is hinted at in the comment:

function game_start() {
// called when the game starts, before the first room is loaded

The game starts in room 1 or intro, so you are setting the transparency for one of those room's objects. You want to put your functions in the before fade-in interaction for the room in which the tree is.

Hope this helps!
Title: Re:!SetObject transparency!
Post by: on Tue 05/08/2003 15:17:36
To be exact I clicked the "edit script" button ({}) in the "Room(2) settings"-screen and typed the script there.
Isn't that how it should be done, because I tried to type it in the global script but then it wouldn't know which room and a fatal error message came up.  
Title: Re:!SetObject transparency!
Post by: on Tue 05/08/2003 15:23:30
Thank you! It now works perfect!