0 registered members (),
1,397
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: A few questions about lite-C game development
[Re: oliver2s]
#431188
10/10/13 21:20
10/10/13 21:20
|
Joined: Oct 2013
Posts: 21
kmega00
OP
Newbie
|
OP
Newbie
Joined: Oct 2013
Posts: 21
|
In my example I use it to switch between A8 PhysX DLL and the Community PhysX3 DLL. I just have set or unset "#define USE_PHYSX3" and the whole code is changing. Thanks Great example. I'm still on A7 (I also understand PHYSX is for A8) but I still understand however... How would you set or unset "#define USE_PHYSX3" ?
|
|
|
Re: A few questions about lite-C game development
[Re: alibaba]
#431355
10/14/13 19:41
10/14/13 19:41
|
Joined: Oct 2013
Posts: 21
kmega00
OP
Newbie
|
OP
Newbie
Joined: Oct 2013
Posts: 21
|
Thanks for the info. Another question (Engine Objects/ENTITY/Events/EVENT_DISCONNECT)
function disconnect_event()
{
if (event_type == EVENT_DISCONNECT)
{
ptr_remove(me);
}
}
action actor()
{
...
my.emask |= ENABLE_DISCONNECT; // sensible for disconnects
my.event = disconnect_event;
...
}
I'm assuming that any entity with ENABLE_DISCONNECT attached will definitely know when it's client has indeed disconnected without fail. Another question under (Engine Objects, ENTITY, Script parameters, skill1..skill100) Skills can also be accessed through an array index from 0 to 99, f.i. my.skill1 == my.skill[0]. Is the manual stating my.skill3 is the same as my.skill[2] ?
my.skill3 = 100;
my.skill[2] = 100;
Both statements above sets my.skill3 to (100)? Manual (Engine Objects, ENTITY, Script parameters, string1, string2)
str_cpy(name_str,my.string1);
Please give another example on how entity.string is used/or what it can be used for. Thanks.
Last edited by kmega00; 10/14/13 23:43.
|
|
|
Re: A few questions about lite-C game development
[Re: kmega00]
#431413
10/15/13 20:13
10/15/13 20:13
|
Joined: Oct 2013
Posts: 21
kmega00
OP
Newbie
|
OP
Newbie
Joined: Oct 2013
Posts: 21
|
When I try to run this example from the manual in: (Engine Objects, PARTICLE, [BEAM,STREAK])
function p_alphafade (PARTICLE *p)
{
p.alpha -= p.skill_a*time_step;
if (p.alpha <= 0) p.lifespan = 0;
}
function p_trace (PARTICLE *p)
{
set (p,BRIGHT | TRANSLUCENT | BEAM);
p.size = 2;
p.skill_a = 1; //fade factor
p.event = p_alphafade;
}
//entity that runs in circles and leaves a vapor trail
action tracer ()
{
var dist = 0,radius = 10,sign = 1;
VECTOR last_pos;
while (1)
{
vec_set (last_pos,my.x);
dist += 30*time_step;
radius += sign*random(3)*time_step; //change radius randomly
if (radius > 150) sign = -1;
else if (radius < 30) sign = 1;
my.x = radius*sin(dist);
my.y = radius*cos(dist);
effect (p_trace,1,my.x,vec_sub(last_pos,my.x));
wait (1);
}
}
function main ()
{
vec_set (sky_color, vector (50,1,1)); //dark blue
level_load (NULL);
video_window (NULL, NULL, 0, "Vapor trail demo");
vec_set (camera.x, vector (-250,0,50));
vec_set (camera.pan, vector (0, -15,0));
ent_create (NULL, vector (0,0,0),tracer);
}
I get a compiler error message Error in line 3: 'var' undeclared identifier < var myvariable = 123.456; > Error E355: Startup failure - any key to abort Would anyone know how to make this code error free? Thanks. Planet lineup from my abandoned 3D space game
|
|
|
Re: A few questions about lite-C game development
[Re: oliver2s]
#431415
10/15/13 20:20
10/15/13 20:20
|
Joined: Oct 2013
Posts: 21
kmega00
OP
Newbie
|
OP
Newbie
Joined: Oct 2013
Posts: 21
|
You need to include Acknex in the very first line of the code: Just tried it and still does not work. Same error message.
|
|
|
Re: A few questions about lite-C game development
[Re: oliver2s]
#431426
10/16/13 02:35
10/16/13 02:35
|
Joined: Oct 2013
Posts: 21
kmega00
OP
Newbie
|
OP
Newbie
Joined: Oct 2013
Posts: 21
|
This is the whole example code from the A7 manual in: (Engine Objects, PARTICLE, [BEAM,STREAK]
function p_alphafade (PARTICLE *p)
{
p.alpha -= p.skill_a*time_step;
if (p.alpha <= 0) p.lifespan = 0;
}
function p_trace (PARTICLE *p)
{
set (p,BRIGHT | TRANSLUCENT | BEAM);
p.size = 2;
p.skill_a = 1; //fade factor
p.event = p_alphafade;
}
//entity that runs in circles and leaves a vapor trail
action tracer ()
{
var dist = 0,radius = 10,sign = 1;
VECTOR last_pos;
while (1)
{
vec_set (last_pos,my.x);
dist += 30*time_step;
radius += sign*random(3)*time_step; //change radius randomly
if (radius > 150) sign = -1;
else if (radius < 30) sign = 1;
my.x = radius*sin(dist);
my.y = radius*cos(dist);
effect (p_trace,1,my.x,vec_sub(last_pos,my.x));
wait (1);
}
}
function main ()
{
vec_set (sky_color, vector (50,1,1)); //dark blue
level_load (NULL);
video_window (NULL, NULL, 0, "Vapor trail demo");
vec_set (camera.x, vector (-250,0,50));
vec_set (camera.pan, vector (0, -15,0));
ent_create (NULL, vector (0,0,0),tracer);
}
I realize that most of the examples from the Acknex manual will not run on it's own however I would most appreciate any help in rewriting this example into something that can run without error so it can be experimented with Thanks.
|
|
|
|