Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, Akow, 7th_zorro), 756 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
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
K
kmega00 Offline OP
Newbie
kmega00  Offline OP
Newbie
K

Joined: Oct 2013
Posts: 21
Originally Posted By: oliver2s
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: kmega00] #431194
10/11/13 06:41
10/11/13 06:41
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
You can do that by script:
#define USE_PHYSX3

Or by command line:

-d USE_PHYSX3


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: A few questions about lite-C game development [Re: kmega00] #431195
10/11/13 06:44
10/11/13 06:44
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
You set it by just typing "#define USE_PHYSX3" in your script. And you unset it by deleting that line or comment it out "//#define USE_PHYSX3".

Re: A few questions about lite-C game development [Re: oliver2s] #431196
10/11/13 07:14
10/11/13 07:14
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Whoops, missed the question grin


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
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
K
kmega00 Offline OP
Newbie
kmega00  Offline OP
Newbie
K

Joined: Oct 2013
Posts: 21
Thanks for the info.
Another question (Engine Objects/ENTITY/Events/EVENT_DISCONNECT)

Code:
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] ?
Code:
my.skill3 = 100;
my.skill[2] = 100;


Both statements above sets my.skill3 to (100)?

Manual (Engine Objects, ENTITY, Script parameters, string1, string2)
Code:
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
K
kmega00 Offline OP
Newbie
kmega00  Offline OP
Newbie
K

Joined: Oct 2013
Posts: 21
When I try to run this example from the manual in:
(Engine Objects, PARTICLE, [BEAM,STREAK])

Code:
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: kmega00] #431414
10/15/13 20:15
10/15/13 20:15
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
You need to include Acknex in the very first line of the code:

Code:
#include <acknex.h>


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
K
kmega00 Offline OP
Newbie
kmega00  Offline OP
Newbie
K

Joined: Oct 2013
Posts: 21
Originally Posted By: oliver2s
You need to include Acknex in the very first line of the code:

Code:
#include <acknex.h>



Just tried it and still does not work. Same error message.

Re: A few questions about lite-C game development [Re: kmega00] #431416
10/15/13 20:25
10/15/13 20:25
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
In your code above there's no "var" in line 3. Please post the complete code.

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
K
kmega00 Offline OP
Newbie
kmega00  Offline OP
Newbie
K

Joined: Oct 2013
Posts: 21
This is the whole example code from the A7 manual in:
(Engine Objects, PARTICLE, [BEAM,STREAK]
Code:
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 grin
Thanks.

Page 2 of 3 1 2 3

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