2 registered members (7th_zorro, dr_panther),
724
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Some short not working code
#402970
06/12/12 22:31
06/12/12 22:31
|
Joined: Aug 2011
Posts: 133 Germany, Supergeheimes Hinter-...
gameplan
OP
Member
|
OP
Member
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_Effectvec_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: krial057]
#402987
06/13/12 07:51
06/13/12 07:51
|
Joined: Apr 2008
Posts: 245
GameScore
Member
|
Member
Joined: Apr 2008
Posts: 245
|
i think you should change into 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-...
gameplan
OP
Member
|
OP
Member
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
|
Here the whole code: Still doesnt work. 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
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
try using VECTOR* and you need to fill a Vector INSIDE a function 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'
|
|
|
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-...
gameplan
OP
Member
|
OP
Member
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: Rei_Ayanami]
#403045
06/13/12 18:54
06/13/12 18:54
|
Joined: Aug 2011
Posts: 133 Germany, Supergeheimes Hinter-...
gameplan
OP
Member
|
OP
Member
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
|
Manual: 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
|
|
|
|