Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,649 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: event in C-Lite [Re: TWO] #122747
04/10/07 17:27
04/10/07 17:27
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
one more thing. is there any event thats replaces
ENABLE_BLOCK because it wont work. but all the other events work for now.


Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,
Re: event in C-Lite [Re: Tiinusen] #122748
04/10/07 17:29
04/10/07 17:29
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Do you move the entity with move/c_move?

Re: event in C-Lite [Re: TWO] #122749
04/10/07 17:30
04/10/07 17:30
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
I uses c_move


Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,
Re: event in C-Lite [Re: Tiinusen] #122750
04/10/07 17:33
04/10/07 17:33
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Then please show me some code

Edit: Better idea, come in the chat.

Re: event in C-Lite [Re: TWO] #122751
04/10/07 17:35
04/10/07 17:35
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
Here you go.

Code:
  
function remove_bullets()
{
error("bort");
ent_remove (my);
}

action bullet(){
me.scale_x = 0.5;
me.scale_y = 0.5;
me.scale_z = 0.5;

var tagged;
var start = 0;
my.emask |= (ENABLE_IMPACT|ENABLE_BLOCK);
my.event = remove_bullets;


while(true){
tagged = c_move(me,vector(4*speed,0,0),nullvector,NULL);
start += 1;


wait(1);
}

}





I want my bullet to be removed when it hits a wall.
or if it hits an entity. it chould act different on both. so thats why
i need to know how.


Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,
Re: event in C-Lite [Re: Tiinusen] #122752
04/10/07 18:02
04/10/07 18:02
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
its not the clearest code i know. because i got some fool variables thats not meant to do anything. just to be there to find a purpose in later usage.

But the question still remains


Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,
Re: event in C-Lite [Re: Tiinusen] #122753
04/10/07 18:05
04/10/07 18:05
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Please come in the chat (button in the top bar). I didn't got your question.

Re: event in C-Lite [Re: TWO] #122754
04/10/07 19:15
04/10/07 19:15
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
Here it the code

Code:
  
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

ENTITY* hos;
var speed = 1;

action none(){
wait(1);
my->flags |= PASSABLE;
me.scale_x = 0.04;
me.scale_y = 0.04;
me.scale_z = 0.04;
var tmp;
var temp;
while(true){


// GUN STATS
vec_for_vertex(tmp,hos,361);
vec_set(me.x,tmp);
vec_for_vertex(temp,hos,my.skill1);
vec_set(tmp,temp);
vec_sub(tmp,me.x);
vec_to_angle(me.pan,tmp); // now MY looks at YOU
wait(1);
}
}

function remove_bullets()
{
wait(1);
if(event_type == EVENT_ENTITY){
error("hited a entity");
}
if(event_type == EVENT_SURFACE){
error("hited a surface");
}
if(event_type == EVENT_IMPACT){
error("hited a IMPACT");
}
wait(1);
ent_remove (my);
}

action bullet(){
me.scale_x = 0.02;
me.scale_y = 0.02;
me.scale_z = 0.02;


var tagged;
var start = 0;
my.emask |= (ENABLE_SURFACE|ENABLE_ENTITY);
my.event = remove_bullets;


while(true){
c_move(me,vector(4*speed,0,0),nullvector,GLIDE);
start += 1;


wait(1);
}

}

action jag(){
var temp;
var cam;
var tmp;


var zhead = 30;
var zbody = 30;
var kk;
var walking = 2300;
var attack;
var runner = 300;
var att = 0;
hos = me;
ENTITY* gun = ent_create("mac10.mdl",vector(0,0,0),none);
ENTITY* bl;



while(true){


vec_set(kk,me.x);
c_move(me, vector((0-90), 0, 0), nullvector, GLIDE);
camera.x = me.x;
camera.y = me.y;
camera.z = me.z + zbody + 100;
vec_set(me.x,kk);
vec_set(temp,me.x);
vec_sub(temp,camera.x);
vec_add(temp,vector(0,0,zhead));
vec_to_angle(camera.pan,temp); // now MY looks at YOU

if(key_y == true){
zhead+= 0.2;
}
if(key_h == true){
zhead-= 0.2;
}
if(key_j == true){
zbody+= 0.2;
}
if(key_g == true){
zbody-= 0.2;
}

if(key_a == true){
me.pan += time_step*3.2*speed ;
}
if(key_d == true){
me.pan -= time_step*3.2*speed ;
}

if(key_w == true){

if(key_shift == true){
c_move(me, vector(15 * time_step *speed, 0, 0), nullvector, GLIDE);
ent_animate(me,"run",walking,ANM_CYCLE);
walking += time_step * 12 *speed;
}else{
c_move(me, vector(3 * time_step *speed, 0, 0), nullvector, GLIDE);
ent_animate(me,"walk",walking,ANM_CYCLE);
walking += time_step * 3 *speed;
gun.skill1 = 358;

}

}
if(key_s == true){
c_move(me, vector((0-3) * time_step *speed, 0, 0), nullvector, GLIDE);
ent_animate(me,"walk",walking,ANM_CYCLE);
walking -= time_step * 3 *speed;
gun.skill1 = 358;
}


if(key_space == true && att >= 0){
attack = 0;
att = 0-180;
gun.skill1 = 39;




}
if(att < 0){
gun.skill1 = 39;
ent_animate(me,"attack",attack,ANM_ADD);
attack += time_step * 16 *speed;

if(att == 0-180 || att == 0-90){
var last;
vec_for_vertex(last,gun,72);
bl = ent_create("bullet.mdl",vector(0,0,0),bullet);
vec_set(bl.x,last);
bl.pan = gun.pan - 180;
}

att += 2 *speed;
gun.skill1 = 39;

}



wait(1);
}

}

action prop(){
phent_settype (me, PH_RIGID, PH_POLY); // set the physics entity type
phent_setmass (me, 3, PH_POLY); // and its mass
phent_setfriction (me, 80); // set the friction
phent_setdamping (me, 40, 40); // set the damping
phent_setelasticity (me, 50, 20); // set the elasticity
}

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

action milita(){
me.scale_x = 0.4;
me.scale_y = 0.4;
me.scale_z = 0.4;
me.pan = 180;
my.emask |= ENABLE_ENTITY;
my.event = hil;
wait(1);
var idle = 0;
while(true){
ent_animate(me,"walk",idle,ANM_CYCLE);
idle += 3 * time_step*speed;
c_move(my,vector(0,4*time_step*speed,0),nullvector,GLIDE);
wait(1);
}

}



function main(){
video_mode = 7;
level_load("sooc.wmb");
wait(5);
ph_setgravity (vector(0, 0, -386)); // set the gravity
ent_create ("cbabe.mdl", vector(0,100,-60), jag);

ent_create ("milita.mdl", vector(0,800,-60), milita);
ent_create ("milita.mdl", vector(0,900,-60), milita);
camera.pan = 180;
while(true){
if(key_d == true){
camera.pan += 0.3;

}
if(speed == 1){
while(key_alt == true){
speed = 0.25;

wait(1);
}
}else{
while(key_alt == true){
speed = 1;

wait(1);
}
}


wait(1);

}
}



Last edited by Tiinusen; 04/10/07 20:00.

Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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