Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Sat 12/03/2011 13:48:22

Title: Rain/Snow plugin change view to another view in scene not working..
Post by: barefoot on Sat 12/03/2011 13:48:22
Hi

I have used the rain/snow plugin for a scene which works as it should normally. However, I want to change it's view to large chunks of ice so I changed it's view and have added a ShakeScreenBackground to enhance the new view..

In the normal view it is view 51 and in the chunks of ice it is view 73.. But it won't go as I hoped it would even changing  srSetSnowAmount(0); before the change so I set a Wait but it still won't act as I wish it would.. Has anyone got any pointers that will make this work without getting a dreadful error message?

Both view are ok.


 srSetSnowDriftRange(20, 80);
 srSetSnowDriftSpeed(20, 80);
 srSetSnowFallSpeed(50, 200);
 srChangeSnowAmount(120);
 srSetSnowBaseline(150, 200);
 srSetSnowTransparency(50, 60);
 srSetSnowDefaultView(51, 0); //view=3; loop=0;
 srSetSnowWindSpeed(35);
 srSetSnowAmount(400);




 ShakeScreenBackground (4, 10, 80);
 srSetSnowDriftRange(20, 80);
 srSetSnowDriftSpeed(20, 80);
 srSetSnowFallSpeed(50, 200);
 srChangeSnowAmount(120);
 srSetSnowBaseline(150, 200);
 srSetSnowTransparency(50, 60);
 srSetSnowDefaultView(73, 0); //view=3; loop=0;
 srSetSnowWindSpeed(35);
 srSetSnowAmount(400);


Is it this lot that needs amending and then incorporating into the script:


//===========kind_id===event(always 0)===== view ==== loop ===
srSetSnowView(0,              0,              4,       0);
srSetSnowView(1,              0,              4,       1);
srSetSnowView(3,              0,              3,       1);
//Note: kind_id number 2 use default view in that case.



I get this error with this:


  ShakeScreenBackground (4, 10, 80);
  srSetSnowView(1,              0,              73,       0);


(http://www.brooklandscarco.co.uk/snow-error.png)



cheers

barefoot

Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: Icey on Sat 12/03/2011 14:12:40

//===========kind_id===event(always 0)===== view ==== loop ===
  srSetSnowView(0,              0,              73,       1);                         
srSetSnowView(1,              0,              73,       1);
srSetSnowView(3,              0,              73,       1);


Change them to this.

Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: barefoot on Sat 12/03/2011 14:42:06
Cheers Studio 3...

The change of view works.. but I can't seem to get it to switch off and continue script..

I've got it on Room Fadein and also want it to trigger when stepping on a Region.


ciceman.SayAt(95, 300, 250, "The prism has been entrusted to me. Prepare to meet your doom!!!!");

ShakeScreenBackground (4, 10, 80);

  srSetSnowDriftRange(20, 80);
  srSetSnowDriftSpeed(20, 80);
  srSetSnowFallSpeed(50, 200);
  srChangeSnowAmount(120);
  srSetSnowBaseline(150, 200);
  srSetSnowTransparency(50, 60);
  srSetSnowView(1,              0,              73,       1);                         
  srSetSnowWindSpeed(35);
  srSetSnowAmount(400);
  srSetSnowAmount(0);
  Display("The large chunks of ice missed you by inches!!");
  srSetSnowView(0,              0,              51,       1); 



barefoot

Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: Icey on Sat 12/03/2011 15:15:47
Random thought. Try a wait(1);


ShakeScreenBackground (4, 10, 80);
wait(1);
  srSetSnowDriftRange(20, 80);
  srSetSnowDriftSpeed(20, 80);
  srSetSnowFallSpeed(50, 200);
  srChangeSnowAmount(120);
  srSetSnowBaseline(150, 200);
  srSetSnowTransparency(50, 60);
  srSetSnowView(1,              0,              73,       1);                         
  srSetSnowWindSpeed(35);
  srSetSnowAmount(400);
  srSetSnowAmount(0);
  Display("The large chunks of ice missed you by inches!!");
  srSetSnowView(0,              0,              51,       1); 
wait(1);


Also after looking at you Display line. Do you have one big piece of ice that you want to fall only once?
Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: barefoot on Sat 12/03/2011 15:55:55
Hi Studio3


update.. view does not change with code.. i get the display and the shake...


i have not tried your idea yet..

Its not one big chunk.. its just a large image (about 10x as big as normal image) displayed as normal just larger and looks like a chunk of ice..

cheers
barefoot
Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: Icey on Sat 12/03/2011 16:16:10
Hum...
if my idea does not work try taking the line with the view change and place it after the second wait.
Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: barefoot on Sat 12/03/2011 16:16:29
Hi

the below script works up until the point of returning to default view and then it errors:


ShakeScreenBackground (4, 10, 80);
 
 Wait(1);
 srSetSnowDriftRange(20, 80);
 srSetSnowDriftSpeed(20, 80);
 srSetSnowFallSpeed(50, 200);
 srChangeSnowAmount(120);
 srSetSnowBaseline(150, 200);
 srSetSnowTransparency(50, 60);
 srSetSnowView(0,              0,              51,       1);                          
 srSetSnowWindSpeed(35);
 srSetSnowAmount(400);

 Wait(60);
 srSetSnowView(1,              0,              73,       1);  
 Display("The large chunks of ice missed you by inches!!");
 
 Wait(60);
 srSetSnowView(0,              0,              51,       1);                          
 

barefoot



                 
Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: Icey on Sat 12/03/2011 16:23:20
take the last wait out.
Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: barefoot on Sat 12/03/2011 16:27:56
Hi

ShakeScreenBackground (4, 10, 80);
 
  Wait(1);
  srSetSnowDriftRange(20, 80);
  srSetSnowDriftSpeed(20, 80);
  srSetSnowFallSpeed(50, 200);
  srChangeSnowAmount(120);
  srSetSnowBaseline(150, 200);
  srSetSnowTransparency(50, 60);
  srSetSnowView(0,              0,              51,       1);                         
  srSetSnowWindSpeed(35);
  srSetSnowAmount(400);



it errors here (next part of script)


  Wait(60);
  srSetSnowView(1,              0,              73,       1); 
  Display("The large chunks of ice missed you by inches!!");
  srSetSnowView(0,              0,              51,       1); 


barefoot
Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: barefoot on Sat 12/03/2011 16:55:43
Hi

to recap..

This works and changes to new view:



ShakeScreenBackground (4, 10, 80);
 Wait(1);
 srSetSnowDriftRange(20, 80);
Wait(60);
 srSetSnowDriftSpeed(20, 80);
 srSetSnowFallSpeed(50, 200);
 srChangeSnowAmount(120);
 srSetSnowBaseline(150, 200);
 srSetSnowTransparency(50, 60);
 srSetSnowView(0,              0,              51,       0);  
 srSetSnowView(1,              0,              73,       0);                          


But it refuses to change back and errors here (Wait):

 
    srSetSnowView(1,              0,              73,       0);  
     Wait(60);
    srSetSnowView(0,              0,              51,       0);  


barefoot




Title: Re: Rain/Snow plugin change view to another view in scene not working..
Post by: barefoot on Sat 12/03/2011 17:10:45
Hi

Iv'e come up with this and it works except i can't get it to change back to normal view (51) on it's own.   I really just need to STOP srSetSnowView 1 and let srSetSnowView 0 continue..

It'll do until i can solve changing back..


ShakeScreenBackground (4, 10, 80);
 Wait(1);
 srSetSnowDriftRange(20, 80);
 srSetSnowDriftSpeed(20, 80);
 srSetSnowFallSpeed(50, 200);
 srChangeSnowAmount(120);
 srSetSnowBaseline(150, 200);
 srSetSnowTransparency(50, 60);
 srSetSnowView(0,              0,              51,       0);  
 srSetSnowView(1,              0,              73,       0);                          

 Wait(100);
   
 srSetSnowAmount(0);

cheers

barefoot