Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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 Offline OP
User
Marky Mark  Offline 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 Offline
Expert
xXxGuitar511  Offline
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 Offline OP
User
Marky Mark  Offline 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: Marky Mark] #77078
06/09/06 01:24
06/09/06 01:24
Joined: Jun 2006
Posts: 96
Straight_Heart Offline
Junior Member
Straight_Heart  Offline
Junior Member

Joined: Jun 2006
Posts: 96
post screens too.


You're not as unique as you think you are, try again.
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 Offline OP
User
Marky Mark  Offline 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] #77080
06/18/06 21:47
06/18/06 21:47
Joined: Jul 2002
Posts: 857
Québec
Marky Mark Offline OP
User
Marky Mark  Offline OP
User

Joined: Jul 2002
Posts: 857
Québec
bump?


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 Offline
Expert
xXxGuitar511  Offline
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
Re: Simple questions for my clouds script [Re: xXxGuitar511] #77082
06/24/06 07:16
06/24/06 07:16
Joined: Oct 2003
Posts: 246
A
Alberto Offline
Member
Alberto  Offline
Member
A

Joined: Oct 2003
Posts: 246
Hello

Wed is comparable to other low cost level editors for the example Chartography Shop plus the advantage of being integrated.
I dont like MED too, but just because of its messy and ugly interface
Aa far as features are concerned MED is comparable to other low cost animator tools , again plus the advantage of being integrated
With some touche it could be fine

In my opinion the weak point is the programming language
Ok the entity \action system is smart but syntax is too poor , not comparable for example with Torque
C-lite should be realeased as soon as possible

Re: Simple questions for my clouds script [Re: Alberto] #77083
06/24/06 07:19
06/24/06 07:19
Joined: Oct 2003
Posts: 246
A
Alberto Offline
Member
Alberto  Offline
Member
A

Joined: Oct 2003
Posts: 246
sorry I posted in the wrong thread

Re: Simple questions for my clouds script [Re: xXxGuitar511] #77084
07/14/06 15:07
07/14/06 15:07
Joined: Jul 2002
Posts: 857
Québec
Marky Mark Offline OP
User
Marky Mark  Offline OP
User

Joined: Jul 2002
Posts: 857
Québec
Quote:

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...




I don't understand.. can you elaborate?


Yeah! IE sucks, use Mozilla...
Marc Rémillard.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1