Gamestudio Links
Zorro Links
Newest Posts
Stooq now requires an API key
by k_ivan. 06/10/26 14:39
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
ZorroGPT
by TipmyPip. 06/10/26 13:07
Z12 live performance
by alx. 06/09/26 20:42
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
Zorro 3.01 recoded MMI function issue
by TipmyPip. 06/04/26 05:44
SGT_FW
by Aku_Aku. 05/31/26 11:05
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
5 registered members (alx, TipmyPip, AndrewAMD, Quad, 1 invisible), 3,180 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Seraphinang, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_scan problem , Fehlermeldung E1515 in lite_c #315444
03/15/10 15:35
03/15/10 15:35
Joined: Mar 2010
Posts: 6
I
ich Offline OP
Newbie
ich  Offline OP
Newbie
I

Joined: Mar 2010
Posts: 6
Hallo ihr lieben, ich hoffe das ihr mir weiter helfen könnt.
Ich versuche schon seit Tagen das mit der c_scan anweisung hinzubekommen aber ich schaffe es irgendwie nicht.

Hier ist mein Problem!

Ich starte das level und der Gegner scant den player wobei er dann ein sound ertönen lässt das klappt auch alles ganz gut nur wenn ich dann auf den Gegner schieße kommt immer die Fehlermeldung E1515 Invalid agruments in remove_bullets!

Hier ist der Code wäre schön wenn ihr mir sagen könntet was ich falsch mache!

//STRINGS///////////////////////////////////

STRING* bullet_mdl ="bullet.mdl";

//SOUNDS////////////////////////////////////

SOUND* explosin_wav ="explosin.wav";
SOUND* step_wav = "step.wav";
SOUND* death_wav = "death.wav";

//defines///////////////////////////////////

#define health skill1

//vars - global/////////////////////////////

var health;

//FUNCTIONS/////////////////////////////////

function move_bullets();
function remove_bullets();
function attach_weapon();
action players_code();
function got_shot();
action my_enemy();

//player//////////////////////

action players_code()
{ player = my;
var sounded_once;
var anim_percentage;
set(my, INVISIBLE);
var death_handle;
ent_create ("M.mdl", nullvector, attach_weapon);

while (1)
{
c_move (player,vector(10 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector,
IGNORE_PASSABLE | GLIDE);

vec_set (camera.x, player.x);
camera.z += 30;
camera.pan -= 5 * mouse_force.x * time_step;
camera.tilt += 3 * mouse_force.y * time_step;
player.pan = camera.pan;

wait (1);
}
}


function attach_weapon()
{
VECTOR bullet_pos[3];
set(my, PASSABLE);

while (1)
{
vec_set (my.x, vector (20, -10, 15));
vec_rotate (my.x, you.pan);
vec_add (my.x, you.x);
my.pan = you.pan;
my.tilt = camera.tilt;

if (mouse_left && (total_frames % 10 == 1)) // fire 6 bullets per second at a frame rate of 60
{
vec_for_vertex(bullet_pos, my, 6);

ent_create("bullet.mdl", bullet_pos, move_bullets);

snd_play (explosin_wav, 100, 0);
}
wait (1);
}
}

function move_bullets()
{
var death_handle;

VECTOR bullet_speed[3];
my.emask = ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_BLOCK ;
my.event = remove_bullets;
my.pan = camera.pan;
my.tilt = camera.tilt;
my.skill30 = 1; // player's bullets will have their skill100 set to 999,999
bullet_speed.x = 50 * time_step;
bullet_speed.y = 0;
bullet_speed.z = 0;

while (my)
{
c_move (my, bullet_speed, nullvector, IGNORE_PASSABLE | IGNORE_YOU );
wait(1);
}
}

function got_shot()
{

if (you.skill30 != 1)
{
return;
}

my.health -=10;

if(my.health==0)
{
my.skill99=1;
return;
}
}

action my_enemy()
{
var anim_percentage = 0;
var walk_percentage;
var death_handle;

set(my, POLYGON);

my.health=100;
my.skill99 = 0;
my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY );
my.event = got_shot; // and runs this function when it is hit

while(!player){wait(1);}

while (my.skill99 == 0)
{


if ((c_scan(my.x,my.pan, vector(120, 60, 1000), IGNORE_ME ) > 0) && (you == player))
{
if (!snd_playing(death_handle)) // the alarm sound isn't playing already?
{
death_handle = snd_play(death_wav, 70, 0); // then let's play it!
ent_animate(my, "stand", anim_percentage, ANM_CYCLE); // play the "walk" animation in a loop
anim_percentage += 3 * time_step; // 2 controls the walk animation speed
}
}

else
{
c_move (my, vector(5 * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);
my.pan += 3 * time_step; // make the enemy rotate in a circle
ent_animate(my, "walk", anim_percentage, ANM_CYCLE); // play the "walk" animation in a loop
anim_percentage += 3 * time_step; // 2 controls the walk animation speed
}

wait (1);
}

my.event = NULL;
anim_percentage = 0;

while (anim_percentage < 100) // the loop runs until the "death" animation percentage reaches 100%
{
ent_animate(my, "death", anim_percentage, NULL); // play the "die" animation only once
anim_percentage += 3 * time_step; // "3" controls the animation speed
wait (1);
}


set (my, PASSABLE);// allow the player to pass through the corpse now

}


function remove_bullets()
{
wait(1);
ent_remove(my);
}

Re: c_scan problem , Fehlermeldung E1515 in lite_c [Re: ich] #315455
03/15/10 17:10
03/15/10 17:10
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Probier es mal so (ist i.A. besser, nur skill-Werte und ähnliches in event-Funktionen zu verändern):

function remove_bullets()
{
my.skill2 = 0;
}

function move_bullets()
{
var death_handle;

VECTOR bullet_speed[3];
my.emask = ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_BLOCK ;
my.event = remove_bullets;
my.pan = camera.pan;
my.tilt = camera.tilt;
my.skill30 = 1; // player's bullets will have their skill100 set to 999,999
bullet_speed.x = 50 * time_step;
bullet_speed.y = 0;
bullet_speed.z = 0;

my.skill2 = 1;
while (my.skill2)
{
c_move (my, bullet_speed, nullvector, IGNORE_PASSABLE | IGNORE_YOU );
wait(1);
}
wait(1);
ent_remove(my);
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: c_scan problem , Fehlermeldung E1515 in lite_c [Re: Superku] #315457
03/15/10 17:44
03/15/10 17:44
Joined: Mar 2010
Posts: 6
I
ich Offline OP
Newbie
ich  Offline OP
Newbie
I

Joined: Mar 2010
Posts: 6
danke für die schnelle Antwort funzt super bis denn !


Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | 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