2 registered members (AndrewAMD, ozgur),
1,526
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
minv don't work correctly
#391498
01/13/12 12:03
01/13/12 12:03
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
This script should exit the app if gv_dist reaches the value 22.6 but did not! (V7.86.6)
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
var gv_dist = 0;
PANEL* p_test = {
digits=10, 10, "distance: %3.2f", *, 1, gv_dist);
flags=SHOW;
}
void main(){
video_set(800, 600, 32, 2);
level_load(NULL);
gv_dist=0;
while(gv_dist<22.6){
gv_dist=minv(gv_dist+time_step, 22.6);
wait(1);
}
wait(1);
beep();
error("OK!");
sys_exit(NULL);
}
|
|
|
Re: minv don't work correct
[Re: Superku]
#391538
01/13/12 17:48
01/13/12 17:48
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
I think JCL is looking for one of these C/C++ specialists. There's a simple clue for this (if you konw how the engine handles their constants & variables).
But not all here are pure C/C++ programmer (keep all types in mind), but maybe someone can help...
(Thanx Superku anyhow!)
Last edited by mercuryus; 01/13/12 17:53. Reason: forgotten things...
|
|
|
Re: minv don't work correct
[Re: Petra]
#391546
01/13/12 19:24
01/13/12 19:24
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
Thanx PL.
So it's again not a but *sight* ;)).. - move it.
PS: you never treat me with your sarcasm.
Last edited by mercuryus; 01/13/12 21:03. Reason: addendum
|
|
|
Re: minv don't work correct
[Re: Petra]
#391679
01/14/12 20:10
01/14/12 20:10
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
This is probably not easy to see for a beginner but you can avoid such bugs when you never assume in a comparison that different generated floats have exactly the same value. Thats one of the first things to learn in C courses. Just a note here. Since the introduction of Lite-C we "veterans" of the forums got more and more this sort of feedback. That this is "probably not easy to see for a beginner" and "That's one of the first things to learn in C courses". May I mention that 3DGS has been always advertised that you don't need to learn any different language? And indeed, before Lite-C there never has been any necessity to learn anything but the engine's own language. So, many of us "veterans" learned to program while never seen another language than C-Script and later Lite-C. Maybe, you can now understand that telling us that we are beginners, while we already had programed several games, or at least several prototypes, gets an offending touch. Thank you for your understanding!
|
|
|
Re: minv don't work correct
[Re: Pappenheimer]
#391681
01/14/12 20:37
01/14/12 20:37
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Thank you for your understanding! Though the problem isn't that you should be offended but that the advertising is wrong. You can agree or disagree that type conversion and floating/fixed point precision is a beginner thing or not, outside of this little world it definitely is, since its a key concept of more advanced things =/
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: minv don't work correct
[Re: Pappenheimer]
#391687
01/14/12 23:22
01/14/12 23:22
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Maybe, you can now understand that telling us that we are beginners, while we already had programed several games, or at least several prototypes, gets an offending touch. How compares experience and knowledge about game development to learning a new programming language? It's like real spoken languages in the real word. Take Spanish and Catalan as example: a friend of mine studied German and Spanish and wanted to have a semester abroad in Barcelona, because he is very attracted to that city. The point is, that Barcelona is the capital of Catalonia, a part of Spain, with a very complicated history - long story short, Catalonia is sort of a state without nationality, people there are against the Kingdom of Spain and speak their own language. It really sounds like spanish (I can't tell the difference, though), but is different in pronounciation, grammar, etc. - but similar to French and Spanish, though. What is the end of the story? Well, my friend had to take extra courses and it took him half a year to gain a solid knowledge and some practice in speaking/reading Catalan and he was able to go a year to Barcelona - and even though he is very into languages and very good in roman languages (he also speaks Italian), he said it was super hard to be with the boys there and understand everything; in the end his Catalan was very good, though. What I want to express is, that even though you see lots of similarities between Lite-C and C-Script, they are not the same and you have to face that you are actually in fact a beginner - when related to Lite-C. So, no one wants to offend you by helping you at basic things - because everybody has to understand basic things first to create the most amazing games in the world, later
|
|
|
|