Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A little help needed. #441122
05/13/14 11:26
05/13/14 11:26
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I have made this ball action :

Code:
action theball()
{

my.pan = 100;

set(my, BRIGHT | METAL | UNLIT);
c_setminmax(me);   ////<<< set box for collision

wait(-10);
set(my,TRANSLUCENT);for (my.alpha=95; my.alpha-=10*time_step; my.alpha<1) wait(1);
reset(my,TRANSLUCENT);
ent_remove(me);
}

function throwBall() 
{
ENTITY* entBall = ent_create ("ball.mdl", vector(camera.x, camera.y, camera.z+20), theball);
VECTOR* vBallForce = vector(cos(camera.pan)*90, sin(camera.pan)*10, 0);
pXent_settype (entBall, PH_RIGID, PH_SPHERE);
pXent_addforcelocal (entBall, vBallForce, entBall.x);
pXent_setelasticity(my, 50);
pXent_setfriction(my, 100);
pXent_setdamping (  my, 50, 50 ); 
wait(1);
}




It works now i got this other physics entity i need to disappear on impact ball. I tried it with help of forum member emre but it does not seem to do the trick.

Any ideas ?
Code:
function test_ev()
{
	my.skill10=1;
}
action pyramid() // simple physics-based box
{
	c_setminmax(me);   
	set(my,SHADOW | TRANSLUCENT | BRIGHT);
	my.alpha = 90;
	balk=me;
	pXent_settype(my, PH_RIGID, PH_BOX); // this entity behaves like a box
	pXent_setfriction (balk,0); // set the friction on the ground
	pXent_setdamping (balk,80,80); // set the damping
	pXent_setelasticity (balk,200); // set the elasticity
	pXent_setcollisionflag(my,PHYSIC_BALL,NX_NOTIFY_ON_START_TOUCH  );
	my.event=test_ev;
	while(my.skill10==0)
	{
		wait(1);
	}	
	ent_remove(me);

}
///



I am trying to create a physics small demo tutorial so any help will be credited for sure laugh

thank you for your time


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: A little help needed. [Re: Realspawn] #441123
05/13/14 12:30
05/13/14 12:30
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Oh dear... Well, first of all:

Originally Posted By: Realspawn
I am trying to create a physics small demo tutorial so any help will be credited for sure laugh

Please don't name me (seriously), and please re-think doing a tutorial about something that you apparently don't understand.

That being said, pXent_setcollisionflag() wants the two entities you want to monitor as the first parameters. The first parameter is right, but the second parameter has to be a pointer to the ball. Likely PHYSIC_BALL doesn't even exist (you don't say what "doesn't work"), or it doesn't point to the right entity.



With that out of the way! The code is terrible. Let's forget about the horrendous formatting, things like the following simply don't work, even if you may think it does.
Code:
for (my.alpha=95; my.alpha-=10*time_step; my.alpha<1) wait(1);



Code:
c_setminmax(me);   ////<<< set box for collision


Well, that's nice... And superflous, but I guess the thought counts?

Seriously, I know I tend to nitpicking, but your code has much more serious issues than simple nitpick-able things. Yes, I'm an asshole, I know. But please, do yourself a favour and learn programming. Really. I know you say you aren't a coder, but in that case either stop spreading false knowledge in the form of "tutorials" or actually learn it. Your excuse "but programmers don't learn modelling either" doesn't fly, I'm not going around and write blender tutorials.

Not being a coder is fine. But at least read the documentation and try to understand what you are doing. Programmers that have to touch models up in Blender or similar have to do that too, don't be lazy.

I'm not a Gamestudio coder either, but even I can open up the documentation and read what a function does and what parameters it expects. If you lack the fundamentals to do that, you should NOT write tutorials in any way shape or form. Future users that don't have to re-learn things they learned wrong the first time will thank you.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: A little help needed. [Re: WretchedSid] #441124
05/13/14 13:16
05/13/14 13:16
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
If no one creates tutorials or even update old workshops i still enjoy to do it myself even it means grabbing and collecting codes from the AUM and forum and try to use them.


The pointers frown I should have known that... that's why it's good people take the time to answer. I will dive right into it.

Most of the time i have to look at codes in free demo's the problem is that it is allway burried deep within. So when i use
a code and i see on screen its working then it's oke with me at least it does what i want laugh

When i see the mails i get and the downloads of my workshops and tutorials i know it helps people even if my code is shitty
What pro coders most of the time don't get is that a lot of people are not aiming to create high quality games they want to have fun making something even when it's very simple...we all know people are not able to click a game together without programming as the advertisement screams laugh

Thats what i do having fun in creating and when possible helping people out wherever i can.

BTW i don't think your an ass laugh your in title of having a opinion but there is a big vally between pro coders and people just trying to create for the fun of it laugh

so when my tutorial is done i will make sure to ask a pro coder to look at it before publishing i really appreciated your hint to do that laugh

Now it's time for me to pointers grin
Thank you

i did create the pointer but at start the model disappears before it's even hit confused





Last edited by Realspawn; 05/13/14 13:26.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: A little help needed. [Re: Realspawn] #441169
05/14/14 18:23
05/14/14 18:23
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Realspawn
If no one creates tutorials or even update old workshops i still enjoy to do it myself even it means grabbing and collecting codes from the AUM and forum and try to use them.


Originally Posted By: Realspawn
So when i use
a code and i see on screen its working then it's oke with me at least it does what i want laugh


Originally Posted By: Realspawn
When i see the mails i get and the downloads of my workshops and tutorials i know it helps people even if my code is shitty


There are multiple issues here that I think are worth highlighting. And these are general issues I see very very often, not just something with you personally.

You say that you are helping people and you take that from feedback from people who objectively can't judge how good or bad your code is. Obviously you are not writing tutorials for experienced programmers who can take the context of what they already know and apply it to the new things they learn. This is dangerous, because you are not properly teaching anyone here. If you hack code together for yourself, that's one thing, but actively going out and teaching people wrong things is highly dangerous.

And I mean that very substantial stuff is very much wrong. I don't expect you to make a beginner tutorial that explains when and how to use double-ended queues vs arrays or when to roll the hash tables out, this is advanced stuff. But what you are failing to do is actually properly teaching people what tools are at their disposal and how to effectively use them.

And that is the reason you don't see many tutorials around. Because writing a good tutorial is incredibly hard to get right. Simply putting some code in front of people and describing what it does is not enough. If I take you by your hand, walk up to a car and then say "well, it works by burning dinosaurs that propels it forwards" and then somehow think that eventually you will become a mechanic because of that. Heck, it's not even technically right, because only a marginal part of oil comes from dinosaurs, the most part is dead plant matter.


Of course, not everyone wants to become a top coder, some just want to fuck around and have fun. That's all fine, but how are they supposed to do that? Back to my analogy, I just told you that liquid dinos make a car go vroom, now I give you a set of car thingies and soldering iron and tell you to go nuts. Worst case scenario is that you kill yourself, luckily when writing programs that can't happen (yet). But you may very well destroy the fun people are having and turn them away from programming, because you don't actually teach them how to work with the things they got at hand.

You put a bunch of technically wrong code with sparse and often wrong comments (yes, I actually read your tutorials before I wrote this) in front of people and call it a day. And I'm sorry, that's simply not a tutorial. Programming is complex and hard, let's face it and teaching people wrong knowledge that they have to forget and then correctly learn later isn't going to help the pain for anyone.

An example, your for() loop: It's simply wrong and whatever you think it does, I promise you it doesn't actually do that. And you don't explain how the semantics of a for loop work, you just put technically wrong code in front of people and tell them "that's what it does". Granted, for loops aren't supposed to be the scope of a physics tutorial, but you don't explain that in any other earlier beginner tutorial either, so yeah...
Of course, properly explaining a for loop requires that the user actually knows what an expression is, because a for loop uses them to do the "right" thing. Again, nowhere in your tutorials is explained what an expression in C actually is and how they evaluate. Why? Is that too boring? Sorry, programming is composed to at least some degree of dry theory that is an absolute MUST. Not saying that everyone has to be theoretical computer engineer to do programming, but yeah, there is a basic set of knowledge that has to be present.


The big issue is that people who often times have no idea what they are doing, are the same people who are most willing to help beginners out. Why though? Because people with knowledge have no interest in spoon feeding everything to others. I personally am more than happy to give pointers in the right direction to help people help their problems, but most beginners can't do anything with that. And I have neither the interest nor the time to write full fledged posts to actually get them to the point where they can do something with a proper answer. Fuck, I'd wager that 80% of this forum don't even know how memory works or that floating point arithmetic is non associative. Basic stuff when working with C.


The long story short is, while your intentions are good, you are ultimately doing more harm than good with your tutorials. And again, beginners can't objectively judge your tutorials quality in any way, they simply lack the knowledge for that, so whatever they have to say about is, is more or less meaningless.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: A little help needed. [Re: WretchedSid] #441176
05/14/14 22:38
05/14/14 22:38
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
Well that's a big story reply for someone just asking some help laugh

As i stated before, you’re in title to have an opinion. I simply don't agree with it all laugh
I think everyone should do what he, she likes and thinks is good laugh Live and let live.

I know people that are good coders now and had a fun start in
the beginning using my stuff and tell me that it was some of the inspiration, reasons why they started or why they got into coding. I like it when i see some of my tutorials get redone with better coding (C&C workshop) that is not doing harm (I find that remark way overboard) that is inspiring people and give them a fun start to see codes actually do something. Hell I won a contest with shitty code but it worked and did what it had to do laugh

I love it that there are still people out there that help with giving small samples to show instead referring to a manual or throwing terms around people do not yet know or understand.

Pointers jup i knew that one, impact jup knew that one to
So i use it and understood then heyyyyy with physics it works completely
different but no real examples only a rolling ball or stone or full games in AUM where the code is buried deep within. No new better small examples then the one I found &#61514; and you tell me that that code is shitty to &#61514; I’ll admit I am not they only worst coder ever &#61514;

I also admit I will never be a good coder simple cause i can’t find time to learn it through. And don’t tell me it's an excuse because it's not. I am a dude alone with a fulltime job and bills to pay and little free time. The time i have i use to do fun stuff laugh In my case making music some models and try to create small games just for the fun of it as i am a creative fellow laugh. If i then ask something in the forum someone can respond or not, help or not. If i want lectures i go back to school which in my case is not possible laugh (wish I could)

I have now almost a game ready and I work with a great coder that coded the game. He had a good idea what I needed. Although my basic coding sucked I could show what I need. We hope to wrap it up soon and publish it &#61514; If I did not have asked in the forum I would not have met this dude &#61514;

Well that’s it from me &#61514; no point in endless discussions. I say it again I respect your opinion but don’t agree with it. I do understand you are speaking with lots of coding experience in your mind and that’s a huge different between us.

Realspawn out laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: A little help needed. [Re: Realspawn] #442715
06/30/14 20:13
06/30/14 20:13
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Quote:
Fuck, I'd wager that 80% of this forum don't even know how memory works or that floating point arithmetic is non associative. Basic stuff when working with C.


Floating point arithmetic is not necessarily associative.
-(a+b = b+a n a×b = b×a)-
"(a+b)+c" is not always equal to "a+(b+c)"
grin


Last edited by Random; 06/30/14 20:23.



Moderated by  HeelX, Spirit 

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