Gamestudio Links
Zorro Links
Newest Posts
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
0 registered members (), 1,103 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ilevels and ent_create models changing after load #226058
09/07/08 17:35
09/07/08 17:35
Joined: Jan 2005
Posts: 12
Shelby, Montana
toby2000 Offline OP
Newbie
toby2000  Offline OP
Newbie

Joined: Jan 2005
Posts: 12
Shelby, Montana
i have used george's i levels and his serious grass scrips to create and infinite world- i have modified the grass scripts into sererate new scripts to create a variety of things including trees, sheep, bales of straw, birds (that fly) and others- the problem i am having is that when i load a saved game the functions all work but the models are diferent. like the birds are now sheep (which acctually looks kinna cool, but not what i want) and maybe the birds now represent the grass and so forth- its like a random replacement of the models- like i said the functions still work, i.e. the sheep func still acts like a sheep- its just that the sheep model is now a bale of straw, or a bird, or a tree- i have also created a game before this and the same thing happened like the bad guys that should have been wolves are now the rock or grass model- totally random- like i said the functions still work as they should- just the wrong model- i would appreciate any input i can get- and thank you for you time-

Re: ilevels and ent_create models changing after load [Re: toby2000] #226069
09/07/08 18:31
09/07/08 18:31
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
Can i see the script?
I think that is problem with code..


Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: ilevels and ent_create models changing after load [Re: cro_games] #226073
09/07/08 18:50
09/07/08 18:50
Joined: Jan 2005
Posts: 12
Shelby, Montana
toby2000 Offline OP
Newbie
toby2000  Offline OP
Newbie

Joined: Jan 2005
Posts: 12
Shelby, Montana
here is the crow script- its acctually a pretty nice bird script- looks awesome- its dependent upon the players pos - also i am using the generic menu/opening screen script from aum8(i believe) and the start game opens a funciton that loads all the caracters in the begining- check after the crow script for the last_load_function - thank you

//****crow script
//****modified from the serious grass script by George Pirvu

var number_of_crow = 0; // counts the number of models that are placed in the level at a certain moment

entity* crow;

var player_position1;
var player_position2;

var crow_speed;
var in_front;
var crow_attack;
var walk_speed_crow;


string crow1_mdl = <crow.MDL>;
string crow2_mdl = <crow.MDL>;



function killer_crow();

action place_crow()
{

crow = my;
exclusive_entity;
number_of_crow += 1;
my.enable_detect = on;
my.enable_scan= on;
my.enable_entity = on;
my.enable_impact = on;
my.enable_trigger = on;
my.trigger_range = 300;
my.enable_stuck = on;
my._health = 100;

drop_shadow();

my.event = killer_crow;


my.pan = random(360);
vec_set (temp, my.x);
temp.z -= 3000;
trace_mode =ignore_me + ignore_sprites + ignore_models + use_box;
my.z -= trace (my.x, temp) - (100 + random(300)); // place the crow model on the ground






while (vec_dist(player.x, my.x) < 8000)
{

crow = me;

killer_crow();

//if(my._health <= 0) { crow_die(); return;}
crow_speed.x = 40 * time;
crow_speed.y = 0;
crow_speed.z = 0;
crow_speed *= time;
in_front.x = my.x + 40 * cos(my.pan);
in_front.y = my.y + 40 * sin(my.pan);
in_front.z = my.z;
while (vec_dist (player.x,my.x)<= 175)
{
ent_playsound(me,crow_wav,500);
//PLAY_ENTSOUND(ME,crow_wav,500);
walk_speed_crow.x = 80;
walk_speed_crow.y = 0;
walk_speed_crow.z = 0;
walk_speed_crow *= time;
//if(my._health <= 0) { crow_die(); return;}
ent_cycle("walk",my._animdist);
//PLAY_ENTSOUND(ME,crow_wav,500);
my._animdist += 20 * time;
if(my._animdist >= 100) { my._animdist -= 100; }
temp.x = player.x - my.x;
temp.y = player.y - my.y;
temp.z = player.z - my.z;
vec_to_angle(my_angle,temp);
force = 6;
actor_turn();
force = 1;
move_mode = ignore_passable + ignore_me + ignore_sprites + use_box + glide ;
result = ent_move (walk_speed_crow, nullvector);
//player._score += 1;
killer_crow();

if (result == 0) // got stuck?
{
crow_speed.x *= -1;
my.skill40 = my.pan;
my.skill41 = 30 + random(90);
while (my.pan < my.skill40 + my.skill41)
{
my.pan += 5 * time;
ent_cycle("walk", my.skill20);
my.skill20 -= 10 * time;
my.skill20 %= 100; // loop
move_mode = ignore_passable;
ent_move (crow_speed, nullvector);
wait (1);
}
crow_speed.x *= -1; // restore the initial speed
}

/*
vec_set (temp.x, my.x);
temp.z -= 3000;
trace_mode = ignore_me + ignore_sprites + ignore_models + use_box;
my.z -= trace (my.x, temp);
*/

if (content(in_front) == content_solid)
{
my.skill40 = my.pan;
my.skill41 = 30 + random(90);
while (my.pan < my.skill40 + my.skill41) // rotate 30..120 degrees
{
my.pan += 5 * time;
ent_cycle("walk", my.skill20); // play the "run" animation
my.skill20 += 10 * time;
my.skill20 %= 100; // loop
wait (1);
}
}

wait(1);
}

if (content(in_front) == content_solid)
{
my.skill40 = my.pan;
my.skill41 = 30 + random(90);
while (my.pan < my.skill40 + my.skill41) // rotate 30..120 degrees
{
my.pan += 5 * time;
ent_cycle("walk", my.skill20); // play the "run" animation
my.skill20 += 10 * time;
my.skill20 %= 100; // loop
wait (1);
}
}
else // free to move
{
//if(my._health <= 0) { crow_die(); return;}
ent_cycle("walk", my.skill20); // play the "run" animation
my.skill20 += 10 * time;
my.skill20 %= 100; // loop
move_mode = ignore_passable + glide; // ignore passable entities
result = ent_move (crow_speed, nullvector);
if (result == 0) // got stuck?
{
crow_speed.x *= -1; // then reverse the movement direction
my.skill40 = my.pan;
my.skill41 = 30 + random(90);
while (my.pan < my.skill40 + my.skill41) // rotate 30..120 degrees
{
my.pan += 5 * time;
ent_cycle("walk", my.skill20); // play reversed "run" animation
my.skill20 -= 10 * time;
my.skill20 %= 100; // loop
move_mode = ignore_passable; // ignore passable entities
ent_move (crow_speed, nullvector);
wait (1);
}
crow_speed.x *= -1; // restore the initial speed
}
if (content(in_front) == content_solid)
{

my.skill40 = my.pan;
my.skill41 = 30 + random(90);
while (my.pan < my.skill40 + my.skill41) // rotate 30..120 degrees
{
ent_cycle("walk", my.skill20); // play the "run" animation
my.skill20 += 10 * time;
my.skill20 %= 100; // loop
my.pan += 5 * time;
wait (1);
}
}
}
wait (1);

}

while (vec_dist(player.x, my.x) < 8000)
{
my.alpha = min (100, (10000 / (vec_dist(player.x, my.x))));
wait (1);
}

ent_remove (my);
number_of_crow -= 1;
// killer_crow();
}

function generate_crow()
{
while (player == null) {wait (1);}
while (1)
{
while (player == null) {wait (1);}
while (freeze_mode == 1) {wait(1);}
vec_set (temp.x, player.x);
temp.x += 4000 - random(8000);
vec_set (temp.y, player.y);
temp.y += 4000 - random(8000);
temp.z = player.z + 200;
if ((abs(temp.x - player.x) > 500 ) || (abs(temp.y - player.y) > 500 ))
{
// increase the nexus if you want to have more than 280 crow at once

if (number_of_crow < 100)
{
if (random(1) > 0.5)
{
ent_create (crow1_mdl, temp.x, place_crow);
}
else
{
ent_create (crow2_mdl, temp.x, place_crow);
}
}
}

wait (1);

}
}


function killer_crow
{

my.enable_entity = on;
my.enable_impact = on;
my.enable_trigger = on;
my.trigger_range = 500;
my = crow; // = my;

if (event_type == event_impact && you == player)
{
player._health -= 1;
feather_gib(5);
vec_to_angle(player.pan, bounce);
feather_gib(5);
}
if (event_type == event_trigger && you == player)
{
ent_playsound(me,crow_wav,500);
}

}


//***** last load funtion
//***** load all the npc into game


function last_load_func()
{

camera_dist[0] =125;
camera_dist[1] = -35;
camera_dist[2] = -40;

game_started = 1;

barn_max = 5;
barn_number = 0;
flight_level = 1;

temp_baron_dies = 0;

number_of_barn = 0;
number_of_tree = 0;
number_of_grass = 0;
number_of_straw = 0;
number_of_windmill = 0;
number_of_sheep = 0;
number_of_crow = 0;

wait(1);

randomize();
generate_barn();
generate_tree();
generate_grass();
generate_straw();
generate_windmill();
generate_sheep();
generate_crow();
show_panels();
toggle_fog();

run_panels();

STOP_SOUND enghandle;
wait(1);
enghandle = 0;

}

there are many other things that are going on in my script but perhaps this will be a good start- thanks again for any help


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