|
|
Simple questions for my clouds script
#77075
06/08/06 15:39
06/08/06 15:39
|
Joined: Jul 2002
Posts: 857 Québec
Marky Mark
OP
User
|
OP
User
Joined: Jul 2002
Posts: 857
Québec
|
Hi, I'm trying to make realistic clouds using models. I know you'll say models are not a good way to make clouds look real, but I want to try it. I started my code, and got some questions. They are in bold in this following script: var formation = 0; var dissipation = 0; var living = 0; //put this function in main function formation = 0; // It is right?// /////////////////////////////////////////////// //Parts of the cloud's formation function show_base { //How to ask the engine to show gradually the model? my.alpha = 100; my.unlit = on; } function show_cloud { //How to ask the engine to show gradually the model? my.alpha = 100; my.unlit = on; } function show_ends { //How to ask the engine to show gradually the model? my.alpha = 100; my.unlit = on; } /////////////////////////////////////////////// /////////////////////////////////////////////// //Parts of the cloud's dissipation function hide_base { //How to ask the engine to hide gradually the model? my.alpha = 0; } function hide_cloud { //How to ask the engine to hide gradually the model? my.alpha = 0; } function hide_ends { //How to ask the engine to hide gradually the model? my.alpha = 0; } /////////////////////////////////////////////// function formation_cloud { //How to ask the engine to execute the functions //show_cloud,then when finished, show_base, then show_ends?} function dissipation_cloud { //How to ask the engine to execute the functions //hide_cloud,then when finished, hide_base, then hide_ends?} action cloud_RmZ { //How to do those following steps: //When var formation is turned to 1 (set by the game), executes formation_cloud function. //Turns var formation to 0 and var living to 1 when the formation_cloud function has finished. //When var living is set to 1, execute my wheater functions (let a space) //Lets say 10 minutes after, Turns var living to 0 and var dissipation to 1 //When var dissipation is set to 1, execute dissipation_cloud function.} Thanks in advance for your help 
Yeah! IE sucks, use Mozilla... Marc Rémillard.
|
|
|
Re: Simple questions for my clouds script
[Re: Marky Mark]
#77076
06/08/06 23:46
06/08/06 23:46
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Code:
define FormSpeed, 2; // Speed to form/dissipate clouds
var formation = 0; var dissipation = 0; var living = 0;
//put this function in main function formation = 0; //It is right? // In main function, (this is not it) //
/////////////////////////////////////////////// //Parts of the cloud's formation
function show_base { my.unlit = on; while(my.alpha < 100) { my.alpha = min(my.alpha + (FormSpeed * time), 100); wait(1); } }
function show_cloud { my.unlit = on; while(my.alpha < 100) { my.alpha = min(my.alpha + (FormSpeed * time), 100); wait(1); } }
function show_ends { my.unlit = on; while(my.alpha < 100) { my.alpha = min(my.alpha + (FormSpeed * time), 100); wait(1); } }
///////////////////////////////////////////////
/////////////////////////////////////////////// //Parts of the cloud's dissipation
function hide_base { while(my.alpha > 0) { my.alpha = max(my.alpha - (FormSpeed * time), 0); wait(1); } }
function hide_cloud { while(my.alpha > 0) { my.alpha = max(my.alpha - (FormSpeed * time), 0); wait(1); } }
function hide_ends { while(my.alpha > 0) { my.alpha = max(my.alpha - (FormSpeed * time), 0); wait(1); } }
///////////////////////////////////////////////
function formation_cloud { show_cloud(); show_base(); show_ends(); }
function dissipation_cloud { hide_cloud(); hide_base(); hide_ends(); }
action cloud_RmZ { while(1) { if (formation == 1) { formation_cloud(); formation = 0; living = 1; sleep(600); living = 0; dissipation = 1; dissipation_cloud(); } wait(1); } }
You're welcome... BTW: If somethings not right, don't get all pist. Just give a better explanation.
xXxGuitar511 - Programmer
|
|
|
Re: Simple questions for my clouds script
[Re: xXxGuitar511]
#77077
06/09/06 01:23
06/09/06 01:23
|
Joined: Jul 2002
Posts: 857 Québec
Marky Mark
OP
User
|
OP
User
Joined: Jul 2002
Posts: 857
Québec
|
I didnt tried yet, but it seems to be what I need. Thanks a lot and I'll post if I get any problems.
Yeah! IE sucks, use Mozilla... Marc Rémillard.
|
|
|
Re: Simple questions for my clouds script
[Re: Straight_Heart]
#77079
06/09/06 20:27
06/09/06 20:27
|
Joined: Jul 2002
Posts: 857 Québec
Marky Mark
OP
User
|
OP
User
Joined: Jul 2002
Posts: 857
Québec
|
Hey, Ive got a little problem. I have to tell the engine who is Cloud base, cloud and ends. How could I add, in the show_X and hide_X functions, a script that asks for the entity name. For example, in wed, if I name a cloud's model "base", the script will associate it with the functions show_base and hide_base.
Thanks in advance
Yeah! IE sucks, use Mozilla... Marc Rémillard.
|
|
|
Re: Simple questions for my clouds script
[Re: Marky Mark]
#77081
06/23/06 23:33
06/23/06 23:33
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
not exactly sure...
The first thing that comes to mind is this:
once, during the first frame, do a scan through all of the entities, and if thier name = "base", then add them to an array of cloud bases. Same with the other pieces...
xXxGuitar511 - Programmer
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|