MystyMood is here...

Posted By: Loopix

MystyMood is here... - 10/21/07 03:09

Hello community

A couple of months ago I decided to update and bundle all that outdated environment stuff on my HD...mainly pushed by two projects that were showing interest in some of my environment ideas (Chooper-Zone and Territory...both will be released later this year...hopefully )

MystyMood is an environment template that should work with any other code within any 3dgs-outdoor-project. There are two versions: A6 and A7(wich includes realtime water reflection). Almost any value is easyly adjustable and as it is not heavyly shader powered, it might run at acceptable framerates

MystyMood contains a html helpfile with some usefull express-tutorials for outdoor level building. There is also an online version of the helpfile...it's telling more details about the features.
MystyMood also contains a demolevel to examine!

You can find the MystyMood download on my site (easy...->templates...)

I want to specialy thank Slin who helped me to get the shorebreak working...and with some other coding issues as well Thanks also to xXxGuitar511 for the awesome fog-fade-code...and to ventilator for the image writing code from the wiki!

Finaly you should know that I'm not really a coder and that all this could probable be made with half the code

Here a few pictures of the demo-level showing the mood/weather/daytime changes:







Posted By: Nems

Re: MystyMood is here... - 10/21/07 04:03

Awesome thanks Loopix, could really use some of these.
Love the shore break effect.
Posted By: Anonymous

Re: MystyMood is here... - 10/21/07 07:56

Thx Loopix,
But a question, how do you do these nice softshadows in picture one from the palms??
Posted By: Loopix

Re: MystyMood is here... - 10/21/07 08:48

MystyMood contains a shadowbaker that lets you bake object shadows into an existing terrain shadowmap (wich is anyway being created when using Earthsculptor). It does this by pressing the g-key on your keyboard (when in shadow generation mode). Same with the shorebreak generation (by pressing the h-key).
Please read the manual for more information...it's all explained there

thx!
Posted By: Pappenheimer

Re: MystyMood is here... - 10/21/07 09:20

Unbelievable! Fantastic contribution!
Posted By: Why_Do_I_Die

Re: MystyMood is here... - 10/21/07 09:36

very generous , thnx
Posted By: Lennart_hillen

Re: MystyMood is here... - 10/21/07 10:02

Wonderful contribution loopix! Indeed very generous!
Posted By: RobH

Re: MystyMood is here... - 10/21/07 10:16

Fantastic contribution! Thanks for this Loopix.
Posted By: demiGod

Re: MystyMood is here... - 10/21/07 10:39

Very very generous!
Posted By: Loopix

Re: MystyMood is here... - 10/21/07 10:41

Thanks for appreciating I just noticed some false default value settings and will now upload a fixed version...should be ready in half an hour.

I'll be gald for bug reports and help assistance

known bugs:
-when using realtime reflection for a second small watersurface (e.g. river) within the same view, there will be a view angle issue...not too disturbing but maybe someone knows how to fix this?

-with very fast weather_fadespeed settings, the fog adjustment may flicker!

-With A7 (I think JCL made some changes on how the sky entities are rendered) I get sun and moon distortions in the zenith...maybe I should simply use normal view entities

-probable some other bugs


btw. I'll be glad to see improovements from anyone on this open source project...I'm really a poor coder and would like to learn how to do better...
Posted By: immersionfx

Re: MystyMood is here... - 10/21/07 10:54

Wonderfull contribution as always Loopix!

I'm amazed that each time you say that you are no coder and, yet, this is pro stuff for many coders around here (me included)
Posted By: RobH

Re: MystyMood is here... - 10/21/07 12:20

Maybe some of the coders can convert it to lite-C ?? I have no idea how to do it.
Posted By: Loopix

Re: MystyMood is here... - 10/21/07 12:28

Quote:

Maybe some of the coders can convert it to lite-C ?? I have no idea how to do it.




That would be great! I'd be willing to compensate such work with free plant packs
Posted By: DavidLancaster

Re: MystyMood is here... - 10/21/07 13:21

Quote:

Quote:

Maybe some of the coders can convert it to lite-C ?? I have no idea how to do it.




That would be great! I'd be willing to compensate such work with free plant packs



Thanks Loopix now all you need to do is win a 3DGS competition with such contributions ^^

Your plants remain in 3DGS history for a long long time, they always surface, those trees, those 8 trees, I love em
Posted By: D3D

Re: MystyMood is here... - 10/21/07 13:24

Nice contrib Loopix and free too Thanks!
Posted By: Shadow969

Re: MystyMood is here... - 10/21/07 15:28

Awesome contribution!
Thanx, Loopix!
Posted By: frazzle

Re: MystyMood is here... - 10/21/07 16:20

Looks amazing Loopix, great effort !!
Thanks for the UC

Cheers

Frazzle
Posted By: ISG

Re: MystyMood is here... - 10/21/07 16:39

Amazing contribution.
Thanks Loopix
Posted By: Nems

Re: MystyMood is here... - 10/21/07 16:51

OY, Yes, my fav trees and will be for a very long time.

The green effect I liked alot and the red does interesting things with the waterfall splash spray too.
The night/day cycle is too fast for this demo though.
Posted By: Loopix

Re: MystyMood is here... - 10/21/07 17:03

Thanks all for your kind words...it makes me happy


Quote:

The green effect I liked alot



All forum-mods favorite color is green...that's why I put it in (in fact you can trigger any fogcolor and fog-distance you want...)


Quote:

The night/day cycle is too fast for this demo



You can easily change that at the begining of the sky_template
Code:
var time_speed = 30;//day-night transition speed
var time_speed_night = 50;//time_Speed during night (you can shorten the night!)


Simply lowen those values to your needs
Posted By: sigi

Re: MystyMood is here... - 10/21/07 19:14

Thank You so much, i think this will bring me back to Gstudio. This looks fantastic.
Posted By: Blink

Re: MystyMood is here... - 10/21/07 23:23

thanks loopix, great contribution.
Posted By: Slin

Re: MystyMood is here... - 10/22/07 02:12

Hm...
What should I say... Nice screenshots!
Some things could be better/shorter solved and there are some things where the speed could be improved, but to change this for everything would be a LOT of work.
This should be good enough for beginners and contains a lot of stuff that should be even usefull for advanced 3DGS user and it worth for them to clean the specific parts and make them fit to their needs.
I think it was a good decision to release it for free, otherwise it would have need to be done nearly from scratch.
I am happy that I was able to test it already months ago and to contribute some stuff into it.

@Those calling Loopix a very good scripter (from my position as someone who still needs to learn that much):
Loopix seems to have sometimes awsome ideas on what others could like to have and how it could be realized (shoreline with shoremap) but he gets sometimes stucked on the easiest things and makes simple stuff far to complex. But who does not do that (I do)? Read the MystyMood Scripts and decide on your own if it is good, very good or amazing (hey, at least it works)

Oh, and thanks for this great contribution!
Slin
Posted By: Nems

Re: MystyMood is here... - 10/22/07 04:30

@Loopix LOL but I like to pretend I always liked green,

Thanks for the pointers, will dive in there and enjoy.
Posted By: adoado

Re: MystyMood is here... - 10/22/07 06:00

Wow this looks awesome Especially the shore and the caustics (?). How did you do the terrain BTW?

Great work
Adoado.
Posted By: Loopix

Re: MystyMood is here... - 10/22/07 08:38

@Slin:
Quote:

Loopix seems to have sometimes awsome ideas on what others could like to have and how it could be realized (shoreline with shoremap) but he gets sometimes stucked on the easiest things and makes simple stuff far to complex.



True ...that's also how I organize my dayly life Imagine how it feels, having a brain full of ideas but in the same time being completly code-impaired...that's not funny! Anyway...The reason why I had to force myself (as a non-coder) doing such a thing is that I coulden't find it elsewehre (without having to rely on external dll's).

...but after being so harsh with me, I'm expecting you to eliminate those bugs I mentioned earlier in this thread imidiately...that's the way open source software works...common interest...no?


@adoado:
Quote:

How did you do the terrain BTW?


It's made with Earthsculptor...
Posted By: CD_saber

Re: MystyMood is here... - 10/22/07 12:30

Great constribution!
But can you please tell me, how can I scale the terrain textures?? I'm not able to find this inside the script!

Thx, CD_SABER
Posted By: Loopix

Re: MystyMood is here... - 10/22/07 12:39

Open the terrain_materials.wdl and change this in the "mat_terr_hlsl_1" material:


Code:

Out.Tex5 = inTexCoord0.xy*40; // tiling texture red
Out.Tex6 = inTexCoord0.xy*60; // tiling texture green
Out.Tex7 = inTexCoord0.xy*20; // tiling texture blue
Out.Tex8 = inTexCoord0.xy*40; // tiling texture black


Posted By: CD_saber

Re: MystyMood is here... - 10/22/07 13:01

Thank you for the fast reply!
Now I got two other problems :-)

I put an object in level (a building) and assigned the "act_obj_set" function to it. When I run the level the building "jumps" after a second to another position...

The second thing is that I can't see my river in the level... but it works in the demolevel, i also use the same model... strange


Posted By: Loopix

Re: MystyMood is here... - 10/22/07 16:22

This never happened to me...strange. Are you using hmp or mdl terrain? Is the "to_floor_norm" flag set or not (in the behaviour-panel)? Make sure your building is placed above the terrain!

Does anyone else experiance this?

If you have a ocean/lake watersurface, make sure the river's z-position is slightly higher than the other water planes. Also make sure you don't have any camera.clip_far/clip_near set in your own scripts...

If you want, you can pm me a download link to your project and I will examine.


Posted By: William

Re: MystyMood is here... - 10/22/07 23:14

Thanks for your work Loopix. And also to everyone else who helped make this.
Posted By: S3an

Re: MystyMood is here... - 10/23/07 02:39

Thanks so much for this free resource! It really is a great help to have all these things in ONE package that work together!
Posted By: CD_saber

Re: MystyMood is here... - 10/23/07 11:22

Ok, now I fixed both problems.
But there is another big problem :
The generated shadows do not have the right position... what went wrong?
heres a picture:

Look here

Another problem is that the models with the object action do not have the pan they have in med, how can I switch the auto-pan off?


Posted By: Loopix

Re: MystyMood is here... - 10/23/07 14:00

For the terrain shadows:
Make sure your terrain has vertex #1 in the upper left corner (check that in MED by selecting the the vertice...you'll see the number at the bottom task-bar from MED). If this isen't the case, mirror or rotate the terrain until you get it there (might need to convert the terrain to mdl...and convert it back to terrain). You will also have to mirror/rotate your shadowmap accordingly (before it's used to bake the object shadows in). Also make sure your terrain center is at origin 0,0,0. This problem can appear by importing terrains generated with other software than MED....depending on the software.

For the pan angle:
Simply uncheck the "random_pan" flag in the objects behaviour panel
Posted By: CD_saber

Re: MystyMood is here... - 10/23/07 16:11

The random_pan flag is not checked!!!
Posted By: jemen

Re: MystyMood is here... - 10/27/07 20:05

Loopix it is a mark of good quality.
Thank U.
Posted By: Quad

Re: MystyMood is here... - 11/02/07 23:30

just, wow
Posted By: Loopix

Re: MystyMood is here... - 11/14/07 12:53

Just to let you know...

There is now a lite-c version of MystyMood

Needs the latest A7 public beta to run.

Thanks for conversion to Shadow969 and to D3D who was the initiator!
Posted By: frazzle

Re: MystyMood is here... - 11/14/07 18:36

Great, thanks for the effort

Cheers

Frazzle
Posted By: MDI

MystyMood is here... - 11/14/07 21:17

All is really nice - weather, water, terrain! Only one criminal dislike here -- fps on 10 is tooo les to play anything maded on this map.
Possible in future this you could try balance.
Posted By: D3D

Re: MystyMood is here... - 11/14/07 21:50

I have constant 60fps on my computers. Only on certain position at the waterfall the fps drops. If you get this slowdown on the whole map I think you must update your hardware and of course you can optimize the script to your needs and share your tweak with the community
Posted By: Nicolas_B

Re: MystyMood is here... - 11/15/07 05:27

wow realy realy NICE. THX...
Its run whit 35-60 FPS on a P4 3GHz whit 512mb DDR Ram and a geforce 6600
Posted By: Shadow969

Re: MystyMood is here... - 11/15/07 05:35

35-60 FPS on AMD 1400 Mhz, 1 Gig ram and Radeon 9250 So i don't think it's slow at all
Posted By: DavidLancaster

Re: MystyMood is here... - 11/21/07 02:58

Loopix that water is the BEST! Thanks man you rock so much!
Posted By: Mythran

Re: MystyMood is here... - 12/02/07 19:03

I'm having problems with the water.... (lake) My player just walks over it, like it's a terrain. What may be causing this?
Thanks in advance.
Posted By: D3D

Re: MystyMood is here... - 12/02/07 19:09

What is your movement code? If i'm not mistaken the code inside the MM template is just a camera with collision.
Posted By: Mythran

Re: MystyMood is here... - 12/02/07 20:03

Yes i'm using Kh movement code.

_______________________________________________________________________________

Code:

function scan_floor();
FUNCTION rotate_entity(rotate_angle,rotate_speed);

DEFINE nullframe,-2;
DEFINE blend,-1;
DEFINE stand,0;
DEFINE run,1;
DEFINE walk,2;
DEFINE jump,3;
DEFINE fall,4;
DEFINE attack_a,5;
DEFINE attack_b,6;
DEFINE attack_c,7;
DEFINE attack_d,8;
DEFINE attack_e,9;
DEFINE attack_f,10;

DEFINE move_x,skill22;
DEFINE move_y,skill23;
DEFINE move_z,skill24;
DEFINE force_x,skill25;
DEFINE force_y,skill26;
DEFINE force_z,skill27;
DEFINE velocity_x,skill28;
DEFINE velocity_y,skill29;
DEFINE velocity_z,skill30;
DEFINE animate,SKILL31;
DEFINE animate2,SKILL32;
DEFINE animblend,SKILL33;
DEFINE currentframe,SKILL34;
DEFINE blendframe,SKILL35;

DEFINE z_offset,SKILL50;
DEFINE jumping_mode,SKILL51;
DEFINE gravity,SKILL52;
DEFINE movement_mode,SKILL53;
DEFINE moving,SKILL54;
DEFINE hit_by_player,SKILL55;
DEFINE entity_type,SKILL56;

DEFINE HP, skill57;
DEFINE ATTACK,skill58;
DEFINE DEFENCE,skill59;
Define ATTACK_MODE,flag1;

entity* player_weapon;
entity* target_enemy;


var camera_move_to[3];
var camera_distance = 200;
var camera_pan;
var camera_tilt;

var camera_move_to[3];
var camera_view_to[3];

var fade_toggle = 1; //0 = off; 1 = on
var fade_start = 90;
var fade_end = 60;
var temp3[3];

var space_press = 0;
var mouse_left_press = 0;
var mouse_right_press = 0;
var combo_continue = 0;
var player_lock_on = 0;
var airborne_attack = 0;

var temp2[6];

ACTION attach_weapon {
player_weapon = my;
my.passable = on;
proc_late();
WHILE (you != null) {
vec_for_vertex(temp.x,you,1175); //hand palm base
vec_for_vertex(temp2.x,you,1240); //hand palm tip
vec_set(my.x,temp.x);
vec_diff(temp.x,temp2.x,temp.x);
vec_to_angle(temp.pan,temp.x);
vec_set(my.pan,temp.pan);
wait(1);
}
}

ACTION player_action
{
player = my;
my.entity_type = 0;
my.gravity = 6;
my.z_offset = 6;
my.shadow = on;
ent_create("sword.mdl",my.x,attach_weapon);
player.HP = 25; //initial HP value
player.ATTACK = 5; //initial sword attack value
player.DEFENCE = 1; //initial armor defence value
wait(1);
WHILE (1) { //the main loop
handle_gravity();
handle_movement();
handle_camera();
handle_animation(1);
my.skill60 = 0; //Death
if(player.hp <= 0)
{
player.hp = 0;
while(my.skill60 < 75)
{
my.skill60 += 1;
ent_animate(me,"knockdown",my.skill60,anm_cycle+anm_add);
my.animate += 100 * time; // this changes the animation speed.
my.animate %= 100;
wait(20);
}
wait(48);
exit;
}//
wait(1);
}
}

FUNCTION handle_movement() {
temp.x = -1000;
temp.y = 0;
my.moving = 0;
IF (key_w == 1 && key_s == 0 && key_a == 0 && key_d == 0) { temp.x = camera.pan; }
IF (key_s == 1 && key_w == 0 && key_a == 0 && key_d == 0) { temp.x = camera.pan + 180; }
IF (key_a == 1 && key_s == 0 && key_w == 0 && key_d == 0) { temp.x = camera.pan + 90; }
IF (key_d == 1 && key_s == 0 && key_a == 0 && key_w == 0) { temp.x = camera.pan - 90; }
IF (key_w == 1 && key_a == 1 && key_d == 0 && key_s == 0) { temp.x = camera.pan + 45; }
IF (key_w == 1 && key_d == 1 && key_a == 0 && key_s == 0) { temp.x = camera.pan - 45; }
IF (key_s == 1 && key_a == 1 && key_d == 0 && key_w == 0) { temp.x = camera.pan + 135; }
IF (key_s == 1 && key_d == 1 && key_a == 0 && key_w == 0) { temp.x = camera.pan - 135; }
IF (temp.x != -1000) {
my.moving = 1;
IF (key_shift == 1) { temp.y = 10 * time; } ELSE { temp.y = 15 * time; }
}

IF (my.movement_mode == 0) {
my.move_x = fcos(temp.x,temp.y);
my.move_y = fsin(temp.x,temp.y);
}
IF (my.movement_mode == 1 || my.movement_mode == 2) {
temp.y = fsin((my.animate * 1.2) + 45,15 * time);
my.move_x = fcos(my.pan,temp.y);
my.move_y = fsin(my.pan,temp.y);
temp.y = 0;
IF (temp.x != -1000) { //if we need to rotate whilst attacking (the player is pressing keys to rotate)
temp.y = 1;
}
}

scan_floor();
c_move(my,nullvector,my.move_x,use_aabb | glide | ignore_passable);

IF (target_enemy == null) {
IF (temp.y > 0) { rotate_entity(temp.x,30); }
} ELSE {
vec_diff(temp2.x,target_enemy.x,my.x);
vec_to_angle(temp2.pan,temp2.x);
rotate_entity(temp2.pan,30);
}

IF (my.movement_mode == 0) {
my.gravity = 6;
IF (my.move_x != 0 || my.move_y != 0) { //if we are moving
IF (my.animblend == stand) { //if our current animation is stand
IF (key_shift == 1) { my.blendframe = walk; } ELSE { my.blendframe = run; }
}
IF (my.animblend == run && key_shift == 1) { my.blendframe = walk; }
IF (my.animblend == walk && key_shift == 0) { my.blendframe = run; }
} ELSE {
IF (my.animblend > stand && my.animblend != jump && my.animblend != fall) { //if we arn't moving and our current animation is walk or run, blend and cycle the stand animation
my.blendframe = stand;
}
}
IF (mouse_left == 0 && mouse_left_press == 1) { mouse_left_press = 0; }
IF (mouse_left == 1 && mouse_left_press == 0 && my.animblend >= stand) {
mouse_left_press = 1;
my.blendframe = attack_a;
player.ATTACK_MODE = on;
IF (my.jumping_mode == 1) {
airborne_attack = 1;
} ELSE {
airborne_attack = 0;
}
my.movement_mode = 1;
combo_continue = 0;
}
IF (mouse_right == 0 && mouse_right_press == 1) { mouse_right_press = 0; } ///////////////
IF (mouse_right == 1 && mouse_right_press == 0) {
IF (player_lock_on == 0) {
c_scan(player.x,player.pan,vector(360,180,250),scan_ents | scan_limit); //
IF (you != null) {
IF (you.entity_type == 2) { //make sure you've scanned an enemy
player_lock_on = 1;
target_enemy = you;
}
}
} ELSE {
player_lock_on = 0;
target_enemy = null;
}
mouse_right_press = 1;
}
}
IF (my.movement_mode == 1) {
IF (my.jumping_mode != 10) {
my.jumping_mode = 0;
} ELSE {
IF (my.animate >= 60 && my.animblend >= stand) { my.jumping_mode = 0; }
}
IF (mouse_left == 0 && mouse_left_press == 1) { mouse_left_press = 0; }
IF (mouse_left == 1 && mouse_left_press == 0 && my.animate >= 30 && combo_continue == 0) { mouse_left_press = 1; combo_continue = 1; }
}
IF (my.movement_mode == 2 && my.movement_mode == 0) {
my.jumping_mode = 0;
IF (mouse_left == 0 && mouse_left_press == 1) { mouse_left_press = 0; }
IF (mouse_left == 1 && mouse_left_press == 0 && my.animate >= 30 && combo_continue == 0) { mouse_left_press = 1; combo_continue = 1; }
}
}

FUNCTION handle_gravity()
{
var friction = 0.7;
result = c_trace(vector(my.x,my.y,my.z-5),vector(my.x,my.y,my.z - 1000),use_box | ignore_me | ignore_passable | ignore_models);
IF (result > 10)
{
IF (my.jumping_mode == 2)
{
IF (result > 120)
{
my.animate = 60;
my.jumping_mode = 3;
}
ELSE
{
my.jumping_mode = 0;
}
}
IF (my.jumping_mode == 3 && result <= 120) { my.jumping_mode = 0; }
IF (my.jumping_mode == 0 && my.movement_mode == 0)
{
IF (result > 120 && my.animblend >= stand && my.animblend != jump && my.animblend != fall) {
my.jumping_mode = 3;
my.blendframe = fall;
my.animate2 = 0;
my.animblend = blend;
}
}
my.force_z -= my.gravity * time;
IF (my.movement_mode == 2) { my.force_z = 0; }
}
ELSE
{
IF (my.jumping_mode == 0)
{
my.force_z = -0.1 * result;
IF (key_space == 0 && space_press == 1) { space_press = 0; }
IF (key_space == 1 && space_press == 0 && my.movement_mode == 0 && my.animblend >= stand && my.animblend != jump && my.animblend != fall)
{
space_press = 1;
my.jumping_mode = 1;
my.force_z = 20; //25
my.blendframe = jump;
my.animate2 = 0;
my.animblend = blend;
}
IF (my.jumping_mode == 2 || my.jumping_mode == 3) { my.jumping_mode = 0; }
}


}
if(result >= 0 && result <= 10 && my.jumping_mode != 1)
{
my.z -= result;
my.velocity_z = 0;
my.force_z = 0;
}
my.velocity_z = time_step * my.force_z + max(1-time_step * friction,0) * my.velocity_z;
my.move_z = my.velocity_z * time;
}

//////////////////////////////
//Smooth camera collision
//////////////////////////////
FUNCTION handle_camera() {
camera_pan -= mouse_force.x * 12 * time;
camera_tilt += mouse_force.y * 8 * time;
camera_tilt = clamp(camera_tilt,-50,50);

camera.pan = camera_pan;
camera_distance = fcos(camera_tilt,200);
temp = fcos(camera_tilt,-camera_distance);
vec_set(camera_move_to.x,vector(my.x + fcos(camera.pan,temp),my.y + fsin(camera.pan,temp),my.z + 20 + fsin(camera_tilt,-camera_distance)));

temp = min(1,0.2 * time); //changing 0.5 will change how fast the camera moves, at 1 places us at target, this value is what allows the smooth movement
camera.x += temp*(camera_move_to.x - camera.x);
camera.y += temp*(camera_move_to.y - camera.y);
camera.z += temp*(camera_move_to.z - camera.z);

vec_diff(temp.x,camera.x,my.x);
vec_normalize(temp.x,16);
vec_add(temp.x,camera.x);


c_trace(my.x,temp.x,ignore_me|ignore_passable);

IF (result > 0) {
vec_diff(temp.x,my.x,target.x);
vec_normalize(temp.x,16);
vec_set(camera.x,target.x);
vec_add(camera.x,temp.x);
}

vec_set(camera_view_to.x,my.x);
vec_diff(temp.x,my.x,camera.x);
vec_to_angle(temp.pan,temp.x);
camera.pan = temp.pan;
camera.tilt = temp.tilt + 6;

vec_diff(temp.x,my.x,camera.x);
vec_to_angle(camera.pan,temp.x);
if(fade_toggle == 1)
{
vec_diff(temp.x, my.x, camera.x);
if(fade_start > 0)
{
temp3.x = vec_length(temp.x); // distance from camera to target
if(temp3.x < fade_start)
{
my.transparent = on; // fade to zero depending distance to fade end
player_weapon.transparent = on;
my.shadow = off;
player_weapon.shadow = off;
//NOTE: use 1st max to avoid negative alpha
//use 2nd max to avoid divide by zero
my.alpha = 100 * max(0, ((temp3.x - fade_end) / max(1,(fade_start - fade_end))));
player_weapon.alpha = my.alpha;
}
else
{
my.transparent = off;
player_weapon.transparent = off;
my.shadow = on;
player_weapon.shadow = on;
}
}
}
}

FUNCTION rotate_entity(rotate_angle,rotate_speed) {
IF (my.pan == rotate_angle) { return; }
result = ang(rotate_angle - my.pan);
IF (result > 0) { my.pan += rotate_speed * time; }
IF (result < 0) { my.pan -= rotate_speed * time; }
IF (ang(rotate_angle - my.pan) < 0 && result > 0) { my.pan = rotate_angle; }
IF (ang(rotate_angle - my.pan) > 0 && result < 0) { my.pan = rotate_angle; }
}

FUNCTION handle_sword_collision {
you = null;
vec_for_vertex(temp.x,player_weapon,274); //sword base
vec_for_vertex(temp2.x,player_weapon,54); //sword tip
trace_mode = ignore_me+ignore_passable+use_box;
result = trace(temp.x,temp2.x);
IF (you != null) {
IF (you.entity_type == 2 && you.hit_by_player == 0) {
IF (airborne_attack == 1 && my.animblend == attack_a) {
my.movement_mode = 2;
}
you.hit_by_player = 1;
IF (target_enemy == null) { target_enemy = you; player_lock_on = 1; }
}
}
}
Posted By: Loopix

Re: MystyMood is here... - 12/02/07 22:52

Try to add "ignore_passents" to your c_move code-line.
Posted By: Mythran

Re: MystyMood is here... - 12/02/07 23:49

Nop won't work. I really don't see any problem at all, i thought there was something that could do this and i could have activated it...
I really dont see the problem... I scaled the terrain in wed, could that be the problem?

Why does the player and models dissapear when i turn the camera do the right?
Posted By: Loopix

Re: MystyMood is here... - 12/02/07 23:59

Hmm...strange
You could convert the waterplane (.hmp) into .mdl in MED...and don't forget to set the passable flag!


Quote:

Why does the player and models dissapear when i turn the camera do the right?



Where do you see the relation to your previous problem here??
Posted By: Mythran

Re: MystyMood is here... - 12/03/07 16:53

I see the relation, because it wasen't like that, so when i tryed to make the player to go underwater it started to happend, and gave me other errors...

Edit: indeed, i'm right. I removed you're code, and the models don't dissapear anymore. I'm checking what could be doing this, but i think it has to do with the flare.

Edit Again: When i'm on top of the mountain that problem with the player just dissapears... Strange...
Posted By: Mythran

Re: MystyMood is here... - 12/04/07 20:21

Alright i found the problem.
Somewhere in the sky_template is a camera.arc = 60;
I changed it to 80 now the distance to the player looks better, and he dont dissapear anymore, who would say that was the problem...

Another thing, why does the mountains of my map start fading and showing up, as i move the camera?
Posted By: Stelynn

Re: MystyMood is here... - 12/05/07 20:39

I was wondering if anyone is experiencing trouble with A7 and Litec and the demo. A6 seems to run fine. In A7 with the water shader on I get flickering. With it off I get no flickering. In Litec I get error messages stating it cannot find the model files.
Posted By: Stelynn

Re: MystyMood is here... - 12/06/07 02:24

I was playing with the effects and found that the water reflection is causing my flickering. I turned this off and it stopped. What would be causing this. I have a Radeon 1600 card and have not experienced any problems with shaders before.
Posted By: Stelynn

Re: MystyMood is here... - 12/06/07 23:23

I was playing around with the demo again and found that the demo only flickers when the screen resolution is above 800. 800 and 640 and everything runs fine.
Posted By: Loopix

Re: MystyMood is here... - 12/08/07 11:47

@Mythren
Quote:

Another thing, why does the mountains of my map start fading and showing up, as i move the camera?




If you aasigned the "act_obj_set" action to your mountains, make sure the "fade_dist" is high enough. Setting this value allows softly fading out objects on a certain distancen (for better fps). Also make sure the "near_cam_transparency" flag is not set (if this is set, object will fade out when camera is close).

@Stelynn
Quote:

I was playing around with the demo again and found that the demo only flickers when the screen resolution is above 800. 800 and 640 and everything runs fine.




This sounds like a mipmap issue that seems to happen only with specific graphics cards...but might be due to missing "bmap_to_mipmap(mtl.skin2)" in the water hlsl-material setups (init_mat_hlsl...). You can either add this yourself or wait for the next update wich will be released as soon as this problem is solved.

NOTE: Please always mention the exact Gamestudio version (also beta versions!) when reporting bugs. Thanks!
Posted By: jigalypuff

Re: MystyMood is here... - 12/09/07 20:43

a quick couple of questions loopix, is it possible to use this with a terrain created in paint shop? and if so would i use the terrain i draw as the blend map? i have tried it but it did not seem to work so i just want to make sure. thanks.
Posted By: Loopix

Re: MystyMood is here... - 12/09/07 20:50

It' doesen't matter what software you use to create the terrain. Only thing you need is a rgb(and black) blendmap as first terrain skin...the second skin should be the shadowmap. Take a look at the demo to see how the terrain skins are setup and also look at the manual...then you should manage
Posted By: jigalypuff

Re: MystyMood is here... - 12/09/07 20:59

cheers man, one other thing do i actually need a shadow map? i think i read in your how to that i can create one with your code?
Posted By: Loopix

Re: MystyMood is here... - 12/09/07 21:05

The shadowmap generation is now setup to bake object only shadows directly into an existing terrain shadow map. It would be possible to change the code for creating terrain shadows too...but usualy most terrain creation software creates better shadowmaps then I could achieve with 3dgs.
Posted By: croman

Re: MystyMood is here... - 02/02/08 00:28

Hi,

Loopix, this is awesome. Great job.

Now I have a question. I downloaded mystymood and I set it up like in manual. It worked, completely. But two days after when I start my project there is now sky textures. There is no stars, clouds, sky, only fog. And there is now sun or it is smaller(deformed). Everything else works how I want.
I haven't changed any mm scripts. What can make this wrong? PLease help...
Thanks
Posted By: Frederick_Lim

Re: MystyMood is here... - 02/02/08 03:51

I just discovered this...Amazing! Thank you very much, I will use this in my project.
Posted By: Loopix

Re: MystyMood is here... - 02/02/08 09:04

Are you using bsp-geometrie? If yes, it might be necessary to add a hollow block around your level with the "sky" flag on (in the texture settings)...also make sure you don't have any camera.fog_start/end...and no camera.clip_far/near settings in your own scripts.
Posted By: croman

Re: MystyMood is here... - 02/02/08 14:40

Thanks. it works now, but there is another question.

When I build shadow for terrain it creates empty grey .tga file. And when I create caustics I get caustics on all terrain. I did like it says in manual.
Posted By: croman

Re: MystyMood is here... - 02/05/08 17:03

does anyone know how to fix what I wrote one post above this one? Loopix? Again, when I'm generating shadow for the terrain script creates an empty, no shadows grey terrain_shadowmap_1.tga. I don't get it. Can anyone help please?
Posted By: Nidhogg

Re: MystyMood is here... - 02/05/08 17:23

The only thing I can think of is that you haven't set the
dynamic_day_night var to 0 in the mm_sky_template.
Posted By: Loopix

Re: MystyMood is here... - 02/05/08 21:48

If your Project isen't too big, you can pm me a downloadlink and I'll look what I can do. It's hard to say what could cause this. Do you use the c-script or the lite-c version? Wich version of 3dgs do you use? Do you use your own object actions or the MystyMood object action?
Posted By: Nidhogg

Re: MystyMood is here... - 02/06/08 04:15

Quote:

If your Project isen't too big, you can pm me a downloadlink and I'll look what I can do. It's hard to say what could cause this. Do you use the c-script or the lite-c version? Wich version of 3dgs do you use? Do you use your own object actions or the MystyMood object action?




Hey loopix, I found the problem in the Lite-c version for the shadowmap. You need to replace
Code:

function write_shadowmap_tga(shadowmap_file_name)
//with
function write_shadowmap_tga(STRING* shadowmap_file_name) //Added STRING* to fix invalid pointer error in Blur


Posted By: Loopix

Re: MystyMood is here... - 02/06/08 11:44

I..see! Actually I've corrected this already for an upcoming fix/update of MystyMood wich I will upload as soon as I'm done with some other small fixes.

Thanks Nidhogg!
Posted By: croman

Re: MystyMood is here... - 02/06/08 13:58

nope. it says that dynamic sun (moving sun) will be set to 0 when in shadow generation mode automaticly. I even tryed to set it 0 manualy but same result every time. does anything special must be set in terrain skins in med or anywhere else. I tryed to make shadow map in your demo and removed all trees. now i get unchanged shadow map with trees like before. what i did is next. I checked on shadow gen in wed for terraing i ran it and i pressed g. shadow map was generating and when i saw green letters i shut down the engine with esc. I'm using 7.4 engine.

Please help. Thanks
Posted By: Nidhogg

Re: MystyMood is here... - 02/06/08 17:19

You where asked, which version of MystyMood are you using. The lite-c or A7 c-script version. If your using the lite-c version did you have a look
for the the fix as stated above.

We can't help you if you do not give us as much information as possible.
Posted By: croman

Re: MystyMood is here... - 02/06/08 17:49

c-script sorry I forgot to write this down. any help?
Posted By: Nidhogg

Re: MystyMood is here... - 02/06/08 21:50

Try to update your 3DGS to the latest version and try again.
Maybe the version your using can't handle shaders properly.

You can download the latest update from the download page.

Good luck.
Posted By: jackdupp

Re: MystyMood is here... - 02/12/08 12:30

MystyMood is quite nice
I had decided to use it as a base for a project and it's been coming along nicely, but I've a problem.

Everything runs fine with 'run' but a published version will close after a few seconds. (A7 c-script)

I've noticed even without my additions to MystyMood this seems to happen.

No other problems with other 3DGS published works.

Does anyone have any suggestions on tracking down this problem? does anyone else get this issue when publishing MystyMood ?
Posted By: Shadow969

Re: MystyMood is here... - 02/12/08 12:33

maybe there are missing files in the compiled version?
Posted By: jackdupp

Re: MystyMood is here... - 02/12/08 13:00

Not as far as I am aware, I've compiled it into a resource.
Posted By: jackdupp

Re: MystyMood is here... - 02/12/08 13:11

You're correct. The resource had no directory structures etc. Thanks for the clue :>
Posted By: TTKJonas

Re: MystyMood is here... - 02/24/08 12:51

Hello

First:Sorry for my bad english^^

I have a problem with the realtime water reflections.
After reloading or changing the level in the game, the reflections are wrong.
It seems, that the reflection cam stands on x0,y0,z0 coordinates.

Here is a screenshot
Screenshot
Its not a realistic place for water, but good to show^^
The reflections always rotates with the camera and dont change while walking around the level (red line)

Is there a way to solve this problem?

Greeting
Jonas
© 2024 lite-C Forums