Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,225 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19056 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
generate stones from random position #151780
09/02/07 18:29
09/02/07 18:29
Joined: Jun 2007
Posts: 236
acknex.exe
ACKNEX007 Offline OP
Member
ACKNEX007  Offline OP
Member

Joined: Jun 2007
Posts: 236
acknex.exe
ok.
all i want to do is some stones rotate and coming from random positions.
as we seen in a previous AUM.

so.it will be flying shooter with avoid hitting the stones.

any tips ?

do i need to use ent_create() ?
stone_pos[0]= random(400);
stone_pos[1]= random(400);
stone_pos[3]= random(400);
ent_create ("stone.mdl", stone_pos, stone_action);

i will have the moving , exploding , disappear after a specific position codes in side stone_action().

thanks.

Re: generate stones from random position [Re: ACKNEX007] #151781
09/02/07 20:00
09/02/07 20:00
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
function stone_action
{
var rotrandom;
var moverandom;
my.pan = random(360);
my.tilt = random(360);
my.roll = random(360);
rotrandom.pan = random(10)-5;
rotrandom.roll = random(10)-5;
rotrandom.tilt = random(10)-5;
moverandom.x = random(10)-5;
moverandom.y = random(10)-5;
moverandom.z = random(10)-5;
while(1)
{
// edit this maby white c_rotate/c_move;
// use events not my specialty for exploding ore changing angles
//ent_remove(my); also event
my.pan +=rotrandom;
my.roll +=rotrandom;
my.tilt +=rotrandom;
my.pan +=rotrandom;
my.roll +=rotrandom;
my.tilt +=rotrandom;
wait(1);
}
}

function stone_spanw
{
while(1)
{
stone_pos.x = random(400);
stone_pos.y = random(400);
stone_pos.z = random(400);
// somthing that checks of there is space for you entity
if(stone <20)//max entity's
{
ent_create("stone.mdl",stone_pos,stone_action);
wait(1);
}
wait(1);
}
}


"empty"
Re: generate stones from random position [Re: flits] #151782
09/03/07 06:19
09/03/07 06:19
Joined: Jun 2007
Posts: 236
acknex.exe
ACKNEX007 Offline OP
Member
ACKNEX007  Offline OP
Member

Joined: Jun 2007
Posts: 236
acknex.exe
thanks a lot.i will try this.


EDIT : i modified it a little bit and got this working..i will post here.. after its finished. (in lite-c)

thanks.

Last edited by ACKNEX007; 09/03/07 06:41.
Re: generate stones from random position [Re: ACKNEX007] #151783
09/03/07 07:01
09/03/07 07:01
Joined: Jun 2007
Posts: 236
acknex.exe
ACKNEX007 Offline OP
Member
ACKNEX007  Offline OP
Member

Joined: Jun 2007
Posts: 236
acknex.exe
This is the code i have now. (modified for lite-c).
it generate the stones and rotate them. (event is commented)
Code:

#include <acknex.h>
#include <default.c>


function bounce_event()
{
if (event_type == EVENT_IMPACT)
{
//ent_playsound(my,explode,50);
ent_remove(me); // disappear when hit
}
}

action stone_action()
{
var rotrandom[3];
var moverandom[3];

//my.emask |= ENABLE_IMPACT;
//my.event = bounce_event;
set(my,PASSABLE);
my.pan = random(360);
my.tilt = random(360);
my.roll = random(360);


moverandom[0] = random(10)-5;
moverandom[1] = random(10)-5;
moverandom[2] = random(10)-5;

while(1)
{

//ent_remove(my); also event
my.pan +=random(4)*time_step;
my.tilt +=random(5)*time_step;
result = c_move(me,vector(10*time_step,0,0),nullvector,IGNORE_YOU|GLIDE);

wait(1);
}
}

var stone =0;
function stone_spanw()
{
var stone_pos[3];

while(1)
{

stone_pos[0] = random(400);
stone_pos[1] = random(400);
stone_pos[2] = random(400);
// somthing that checks of there is space for you entity
if(stone <40)//max entity's
{
ent_create("lp_farn.mdl",vector(stone_pos[0],stone_pos[1],stone_pos[2]),stone_action);
wait(1);
stone++;
}
wait(1);
}
}

function main()
{
video_mode = 6;
video_screen = 2;
video_depth = 32;

vec_set(sky_color,vector(0,0,1)); // blue

level_load("main.wmb");
wait (3);
stone_spanw();
camera.x = -600;
camera.y = 300;
camera.z = 150;
}




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

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