Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 05:41
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, AndrewAMD), 1,278 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 5 of 8 1 2 3 4 5 6 7 8
Re: MystyMood is here... [Re: MDI] #162501
11/14/07 21:50
11/14/07 21:50
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
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


smile
Re: MystyMood is here... [Re: D3D] #162502
11/15/07 05:27
11/15/07 05:27
Joined: Apr 2005
Posts: 1,058
Luzern
Nicolas_B Offline
Serious User
Nicolas_B  Offline
Serious User

Joined: Apr 2005
Posts: 1,058
Luzern
wow realy realy NICE. THX...
Its run whit 35-60 FPS on a P4 3GHz whit 512mb DDR Ram and a geforce 6600

Re: MystyMood is here... [Re: Nicolas_B] #162503
11/15/07 05:35
11/15/07 05:35
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
35-60 FPS on AMD 1400 Mhz, 1 Gig ram and Radeon 9250 So i don't think it's slow at all

Re: MystyMood is here... [Re: Shadow969] #162504
11/21/07 02:58
11/21/07 02:58
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline
User
DavidLancaster  Offline
User

Joined: Nov 2004
Posts: 862
Australia
Loopix that water is the BEST! Thanks man you rock so much!

Re: MystyMood is here... [Re: DavidLancaster] #162505
12/02/07 19:03
12/02/07 19:03
Joined: Sep 2006
Posts: 292
M
Mythran Offline
Member
Mythran  Offline
Member
M

Joined: Sep 2006
Posts: 292
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.

Re: MystyMood is here... [Re: Mythran] #162506
12/02/07 19:09
12/02/07 19:09
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
What is your movement code? If i'm not mistaken the code inside the MM template is just a camera with collision.


smile
Re: MystyMood is here... [Re: D3D] #162507
12/02/07 20:03
12/02/07 20:03
Joined: Sep 2006
Posts: 292
M
Mythran Offline
Member
Mythran  Offline
Member
M

Joined: Sep 2006
Posts: 292
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; }
}
}
}

Re: MystyMood is here... [Re: Mythran] #162508
12/02/07 22:52
12/02/07 22:52
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
Try to add "ignore_passents" to your c_move code-line.

Re: MystyMood is here... [Re: Loopix] #162509
12/02/07 23:49
12/02/07 23:49
Joined: Sep 2006
Posts: 292
M
Mythran Offline
Member
Mythran  Offline
Member
M

Joined: Sep 2006
Posts: 292
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?

Re: MystyMood is here... [Re: Mythran] #162510
12/02/07 23:59
12/02/07 23:59
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
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??

Page 5 of 8 1 2 3 4 5 6 7 8

Moderated by  adoado, checkbutton, mk_1, Perro 

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