Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Some short not working code #402970
06/12/12 22:31
06/12/12 22:31
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
Hi,

I have some problems with this code snippet. I get an error message "X is not part of function". This code is part of the rain code from this site:
http://opserver.de/wiki/index.php?title=Basic_Rain/Snow_Effect

vec_set(my.x,vector(
cycle(my.x,camera.x-Weatherbox.x,camera.x+Weatherbox.x),
cycle(my.y,camera.y-Weatherbox.y,camera.y+Weatherbox.y),
cycle(my.z,camera.z-Weatherbox.z,camera.z+Weatherbox.z)));

Maybe it has to do with wdl to lite-c conversion, but I dont have any idee why this lines dont work.

Thanks


Version: A8 free
OS: Windows 10
Re: Some short not working code [Re: gameplan] #402974
06/13/12 00:00
06/13/12 00:00
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline
Member
krial057  Offline
Member
K

Joined: Sep 2007
Posts: 101
Luxembourg
That part seems to be correct. Could you post your whole code? Have you changed var weatherbox[3] to VECTOR weatherbox?

Re: Some short not working code [Re: krial057] #402987
06/13/12 07:51
06/13/12 07:51
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
i think you should change

Code:
var Weatherbox[3];


into
Code:
VECTOR Weatherbox;


couz you work with vectors not with var`s

Re: Some short not working code [Re: GameScore] #403006
06/13/12 13:20
06/13/12 13:20
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
Here the whole code:
Still doesnt work.

Quote:

VECTOR Weatherbox;
VECTOR Wind_direction; //Movement speed and direction

Wind_direction.x = 0;
Wind_direction.y = 0;
Wind_direction.z = -20;

BMAP* Weather_bmap = "raindrop.tga"; //The particle bmap

function Weather_part_event()
{
//keep the particle within the box
vec_set(my.x,vector(
cycle(my.x,camera.x-Weatherbox.x,camera.x+Weatherbox.x),
cycle(my.y,camera.y-Weatherbox.y,camera.y+Weatherbox.y),
cycle(my.z,camera.z-Weatherbox.z,camera.z+Weatherbox.z)));

//update the movement speed and direction
vec_set(my.vel_x,vector(Wind_direction.x,Wind_direction.y,Wind_direction.z));

my.lifespan = 100; // live forever
}

function Weather_part()
{
//place particles at random positions within the box
vec_set(my.x,vector(camera.x+random(Weatherbox.x*2)-Weatherbox.x,
camera.y+random(Weatherbox.y*2)-Weatherbox.y,
camera.z+random(Weatherbox.z*2)-Weatherbox.z));

my.bmap = Weather_bmap;
my.size = random(1)+2;
my.move = on;

my.function = Weather_part_event;
}

function CreateWeatherParticles(cx,cy,cz,numparticles)
{
Weatherbox.x = cx/2;
Weatherbox.y = cy/2;
Weatherbox.z = cz/2;

//create the particles
effect(Weather_part,numparticles,nullvector,nullvector);
}


There is now a new errormessage: "vel_x is not member of ENTITY"

Last edited by gameplan; 06/13/12 13:29.

Version: A8 free
OS: Windows 10
Re: Some short not working code [Re: gameplan] #403007
06/13/12 13:29
06/13/12 13:29
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
try using VECTOR*
and you need to fill a Vector INSIDE a function laugh

as next, use PARTICLE* as effect function argument - like:

function weather_part(PARTICLE* p)

and replace all the 'my' Pointer inside that functions with 'p'


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Some short not working code [Re: Espér] #403034
06/13/12 18:02
06/13/12 18:02
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
I replaced all my pointer with p, now I get this message: "move is not part of PARTICLE"


Version: A8 free
OS: Windows 10
Re: Some short not working code [Re: gameplan] #403037
06/13/12 18:18
06/13/12 18:18
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Schreib's groß, MOVE. Solche Dinge findest du auch raus, wenn du in das Handbuch schaust. Je früher du lernst das Ding zu benutzen desto schneller lernst du die Sprache.

Re: Some short not working code [Re: PadMalcom] #403041
06/13/12 18:30
06/13/12 18:30
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
Nein, das wird nicht großgeschrieben, das gibt sonst einen Syntaxerror. Außerdem verwende ich sehrwohl das Handbuch, kein Grund mich anzugreifen. Des Weiteren wäre es sinnvoller, eine Antwort auf Englisch zu geben, da die bisherige Diskussion ebenfalls auf Englisch geführt wurde.


Version: A8 free
OS: Windows 10
Re: Some short not working code [Re: gameplan] #403043
06/13/12 18:45
06/13/12 18:45
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
There is no "move" only MOVE in LiteC.

If you think otherwise, proof it wink

Re: Some short not working code [Re: Rei_Ayanami] #403045
06/13/12 18:54
06/13/12 18:54
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
Manual:
Quote:

my.move
Ist dieses Flag gesetzt, bewegt sich der Partikel mit seinem Geschwindigkeitsvektor und beschleunigt mit seiner Schwerkraftsbeschleunigung.
Wertebereich:
on - Partikel können sich bewegen
off - keine Partikelbewegung (default:off)



Version: A8 free
OS: Windows 10
Page 1 of 2 1 2

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