Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.


Messages - Khris

Pages: [1] 2 3 ... 428
1
You'll have to ditch the Keyboard movement module. As soon as you want smooth movement that changes speed without stopping in between, player.Walk() goes out the window.

Try this:
Code: Adventure Game Studio
  1. int rotate_left = eKeyLeftArrow;
  2. int rotate_right = eKeyRightArrow;
  3. int move_forward = eKeyUpArrow;
  4. int move_back = eKeySpace;
  5. float forward_speed = 3.0;
  6. float backward_impulse = 5.0;
  7. int back_blocked_frames = 80;  // kick back only possible every x frames
  8. float laziness = 0.05;   // acceleration coefficient
  9.  
  10. // direction of forward movement
  11. float dx, dy = 1.0;  // default: down
  12. float px, py;
  13.  
  14. void on_event(EventType event, int data) {
  15.   if (event == eEventEnterRoomBeforeFadein) {
  16.     px = IntToFloat(player.x);
  17.     py = IntToFloat(player.y);
  18.   }
  19. }
  20.  
  21. void on_key_press(eKeyCode k) {
  22.  
  23.   String loops = "061735240";
  24.   int current_dir = loops.IndexOf(String.Format("%d", player.Loop));
  25.   int old_dir = current_dir;
  26.  
  27.   if (k == rotate_left) current_dir--; if (current_dir == -1) current_dir = 7;
  28.   if (k == rotate_right) current_dir++;
  29.  
  30.   if (current_dir != old_dir) {
  31.     player.Loop = loops.Chars[current_dir] - 48;
  32.     float angle = IntToFloat(current_dir + 2) * Maths.Pi / 4.0;
  33.     dx = Maths.Cos(angle);
  34.     dy = Maths.Sin(angle);
  35.   }
  36. }
  37.  
  38. float speed, target_speed;
  39. int back_locked;
  40.  
  41. void repeatedly_execute() {
  42.  
  43.   if (back_locked) back_locked--;  // count down if locked
  44.    
  45.   if (IsKeyPressed(move_forward) && !IsKeyPressed(move_back)) target_speed = forward_speed;
  46.   else if (IsKeyPressed(move_back) && !IsKeyPressed(move_forward)) {
  47.     if (back_locked == 0) {
  48.       speed = -backward_impulse;
  49.       target_speed = 0.0;
  50.       back_locked = back_blocked_frames; // 2 seconds
  51.     }
  52.   }
  53.   else target_speed = 0.0;
  54.  
  55.   // change current speed
  56.   speed += (target_speed - speed) * laziness;
  57.  
  58.   float xa = dx * speed, ya = dy * speed; // movement vector
  59.  
  60.   // move player
  61.   int tpx = FloatToInt(px + xa, eRoundNearest) - GetViewportX();
  62.   int tpy = FloatToInt(py + ya, eRoundNearest) - GetViewportY();
  63.   if (GetWalkableAreaAt(tpx, tpy)) {
  64.     px += xa;
  65.     py += ya;
  66.     player.x = FloatToInt(px, eRoundNearest);
  67.     player.y = FloatToInt(py, eRoundNearest);
  68.   }
  69.   else speed = 0.0;
  70. }

Tested and should work as-is. (Just put it in a fresh script.)

2
It sounds like you're referring to the Display() command, right?
It uses a so-called TextWindowGUI. You can create your own: http://www.adventuregamestudio.co.uk/manual/ags14.htm#TextWin
If you just want to change the color, import a black 1x1 pixel image into the Sprite manager and set every corner/edge image to that. Then change the background color to the desired number (using the Color pane).

After you're done, remember its number and set it as default text GUI in the General settings pane.

3
Quote
If the scientific methodology easily produced airtight results, there would be a lot more scientific "laws". Especially when something is going to affect me directly, I am not inclined by disposition to just rely on the opinions of people representing themselves as experts.  I want to be convinced.
So every research that doesn't produce something like E=mc² is merely an opinion, and should be met with skepticism? Sorry, no.
Published papers line out what they did and how they did it, and anybody who's an expert in the same field can put it under scrutiny, and they will. Bad stuff gets weeded out by this. Granted, peer review doesn't catch all bad papers, but before something is used to for instance actually treat patients (except in the studies themselves of course), it is going to be under years of more scrutiny (not true for pseudoscience of course, like alternative medicine).

A religious person is talking out of their ass 100% of the time.

Quote
There's lots of ways to get answers.  When I'm thinking up a way to make an adventure puzzle work, I don't use anything resembling a methodical approach.
You're talking about creativity, and you know perfectly well that science doesn't do that. When I said "actual answers", I was talking about stuff like "how do the planets move?" or "let's engineer a bacterium that eats crude oil".

Quote
You are probably going to say "but science doesn't implement the invention, so it's not the methodology's fault."
Exactly. You're talking about ethics and politics, not science.

Quote
Yes pathogens in water kill many people, but the remaining population is stronger from a Darwinian point of view.
"Let's just let all these African children die; if we hadn't invented methods to clean the water, they would die anyway. Their children will be stronger, right?" Right.
Even if this isn't what you said (sure sounds like it though): please note that my point was that religion does NOTHING to save those kids, and it can't, and it never will.

Quote
And this is what I'm talking about in terms of science, compartmentalized and looking only at specific problems in isolated circumstances, not considering the broader implications.
This is pure prejudice, entirely disconnected from reality. It's also again about the ethics of science though. Scientists do consider the broader implications of their work all the time. A scientist who works on improving a plant gene without considering what the implications are will get flack for it by the scientific community.

Quote
Neanderthals
That they were killed by other humans is just one hypothesis. Also, if you have to go back in time that far to find something, I'd wager what I said holds up today. We are not THE BAD. Most people are caring.

Quote
[Science] is, like religion was, an accessory to the crime.
Like I said in my previous posts, science is a tool, religion is much more. The logical pathway from "I believe holy book X is written by the creator of everything" to "let's kill group X" is much more robust and obvious than the one from "I only believe hypotheses that have been verified lots of times, and until they're disproven" to "we must drop two bombs on japan" (hint: there is none).
If you want to be mad at the hammer for hitting yourself on the thumb, go ahead. But don't expect me to follow.

4
No, not in the sense that the bible is.
Science says "to get X, do Y" or "X works like this". It doesn't say "do X" or "do not X". I don't know why this is so difficult to grasp.

5
If we're talking about extremely powerful bombs in general, one application would be to move an asteroid on a collision course with earth out of its trajectory.

When I said, science is an achievement, I was talking about the scientific method, double-blind trials, peer review, etc. The establishment of a reliable way to find "truth", with demonstrable results and built-in self-correction.

Science is just a tool, while religions address questions of why and morality.
Science tells us that humans are just animals, it doesn't say how we should behave though. Comparing science to theism is useless, it's like comparing a hammer to an instruction booklet.

Regarding the forging of understanding: somebody who wants to hold personal beliefs or opinions for good reasons, who's interested in what's actually true, might encounter arguments for or against their positions and change their mind, or at least shift a view point slightly.
It is true that whenever I'm arguing with religious people, my belief that religions are useless, false and can be actually harmful gets reinforced. I didn't wake up one day and decide that that's going to be my belief from now on though, my stance on religions was "forged" over years, mostly by listening to or reading arguments from atheist and theists. It could have gone either way, and had I found the religious side more convincing, I might be religious today.
I don't think it is unreasonable to assume that people who are following this debate and get to hear some of the arguments for the first time could draw something useful out of it.

6
We can talk about Oppenheimer's and his colleagues' motivation all day; when all is said and done, the notion that science dropped the bomb is still nonsensical.
Even if every scientist tortured monkeys, built bombs and created viruses all day, every day, science would still be an amazing, unparalleled achievement.


7
Miguel:
You're conflating science and ethics. Building a bomb is neither bad nor good. Using the bomb is what matters. Science can't tell us whether we should use a bomb or not. It can only tell us what happens if we do (or don't).

By saying that religion is basically the same thing, and whenever people do bad things in the name of religion, their religion isn't to blame, you're ignoring that religions contain ethics, which science does not. All religions ever do is tell people how to behave, and you have used this argument repeatedly to point out why religion is good.

The other thing is, if you ask fundamentalists why they do the bad stuff they do, they will point to their religion. The bible itself says that God isn't the author of confusion, and the people who burned witches or went on crusades were no different.

What you're doing boils down to arguing that whenever somebody religious does something good, it's due to their religion, and whenever they do something bad, it's because they are a bad person.
It should come as no surprise to you that some people are going to disagree with that assessment.

The other thing is that if there are so many people who do bad things despite being religious, what does that say about the effectiveness of that religion...? What I'm saying is that independent of whether Christianity is true, it obviously has failed. Your own stance is that most Catholics are not true followers of Jesus. Have you ever wondered that maybe there's something wrong with Catholicism, and not necessarily with 90% of Catholics?

8
Just for reference, I believe the problem was that with a GUI that is set to be clickable, even the fully transparent parts will catch mouse clicks.
The bit about mouse modes was confusing but not really relevant I guess.

9
Beginners' Technical Questions / Re: Movement detection?
« on: 15 Jun 2013, 11:09 »
You do know about Character.Moving, right?
Quote
readonly bool Character.Moving

Returns true if the character is currently moving, or false if not.

10
Cuiki:
I didn't say I have all the answers, and claiming that there is definitely no god is equally unjustifiable, yes (that's why I don't).
I'm saying this is about probability though, and that of the existence of for instance the God of the Christian Bible is not 50:50.
So as far as an agnostic only says "we cannot know", that's fine, but I feel they must also emphasise at the same time, that it's different with common God claims, like those made by Christianity. Because in those cases, absence of evidence is indeed evidence of absence (because if the claim were true, we should find evidence).
Like Eric mentioned, saying that anything is possible gets you nowhere.

Intense Degree:
This is true, the only objection I would have is that atheists didn't get an equal chance. Back then, everybody was religious (or else...).
Today we have for instance Doctors without borders, a completely secular organization. They don't hold their treatments hostage until their patients read a bible passage with them.
I'm still maintaining that people who wanted to help others have always existed, and those who lived centuries ago simply joined the church in order to do so. It was the natural thing to do.
Religious people claim that believing that Jesus is God makes people help others, and my point is that that belief is not required to want to do good.

Cyrus: this is just your modern, progressive interpretation.
Quote
Christianity is all about love and compassion
Have you ever read the bible...? I am aware that is typically what priests tell people nowadays, but you really shouldn't take their word for it. If you think Christians can simply chuck out the OT, fine, but why call yourself Christian then? You just lost Genesis, Moses, the Commandments.
You are free to redefine a religion to your liking and subsequently call other interpretations misreadings. But don't make it the basis for an argument.

Here's a brilliant debate on the issue:
http://www.youtube.com/watch?v=ZCdnh7G87m4&list=PL87110E560077639E
Everybody should have watched it.

11
Miguel, your assessment of me is completely wrong, plain and simple. I didn't have any bad experience with religion in any form, whatsoever. Until I was 25 or so, I didn't really care either way, because I didn't come into contact with religion in my daily life, at all (except in school, where is was just another boring subject).
What eventually sparked my interest was the debate over Intelligent Design back in 2005. I read about it, was curious and haven't stopped since then. I realized why agnosticism is complacent and prone to make you feel superior for all the wrong reasons. And I oppose ignorance in all forms.

What I hate about religion is not jesus or the bible, what I hate is how religious people remain willfully ignorant, and how they get people killed over unfounded and superstitious beliefs. I don't hate Christianity, I hate people who are stuck in ancient morality, people who let religions corrupt them into becoming abominable assholes, even against their better judgment. What I hate is how religions manage to turn nice, caring human beings into somebody who'll say that owning another human as property is not bad in every circumstance (and who actually believe this!), because they'd rather die than admit that their belief system is full of holes and contradictions.

As for monkey, the "brightest coder in AGS", when I found out he's a Mormon, lots of things went through my head, but "NO!" or anything similar surely wasn't among them.

Quote
And it seams to me that you just don't want to loose a debate, man. You go around picking every little "fault" on one's post and it's common from you to stall conversation and even give opposite meaning to sentences.
This is just meaningless polemics. The same could be said about any of your posts.

I'm currently in this to defend science. Baron's opinion is as common as it is mislead, and I'm simply trying to correct what I deem to be downright dishonest. And like I said before, it doesn't matter who says something; all that matters is the argument itself.

Like Eric and Snarky pointed out, ethics are important in science. In no way do I think that everything we can do, should necessarily be done, too. I'm still quite torn about animal testing for example, in so far as it is unavoidable to find vaccines or cures.

But the notion that we should regard science as one of many approaches that is as good as the next one is so hare-brained and ridiculous it's almost not even worth commenting on.

Quote
I've been trying to say in this debate that modern Catholics can distance themselves from the ancient rules from the Bible, or antiquated resolutions from the Vatican. Modern Catholics follow Jesus and his life more than anything else.
At a point where you disagree with the Vatican of all things, what's even really the point of calling yourself Catholic any longer, "modern" or not? This is the definition of the "no true Scotsman" fallacy.

12
No worries, I wasn't offended, just curious. Learning the shorter ways of doing things will save much time, especially when it comes to debugging, but for a first - and MAGS - game, I completely understand the "I just want it to work" approach :)

13
Again, I don't trust anything that calls itself science blindly. I am well aware that proper science doesn't have all the answers and maybe never will. It IS the only way to get actual answers though. It isn't a force; and what constitutes an acceptable risk for surgical outcomes was determined by people, not science.
You have an extremely personified view of science, thinking that it is something we have to trust (as in faith). This is simply not true. AGAIN, I have "faith" in the methodology, not necessarily every scientist.

It also sounds like you're saying that until science is 100% perfect and has all the answers, you might as well reject it. I just can't understand the reasoning behind this.
If you don't have access to clean water and keep getting sick, wouldn't you treasure a device that destroys 50% of the pathogens? This is what science does, as opposed to religion, which simply tells you that you'll get all the clean water you'll ever want after you die.

You mentioned the invention of the nuclear bomb was when science caused a detriment for society. This is of course a common argument. But there are always risks like that. The decision to actually drop two of them on people was made by politicians, not scientists, and especially not science itself. One could also argue that doing so did not just stop a war and while causing them, also prevented lots of deaths, but it also made sure we'd never drop another one. Maybe it prevented an escalation of the cold war. We'll never know. Still, not an argument against science.
Because even if we start charging up the good against the bad, the good will always win. Accumulation of knowledge and understanding about the universe will always win out against psychopaths who decided to use new technology to kill.

Please point out "successes of religion". Note that in order for these to count, the success must be explicitly based on religious belief or morality. Mentioning a pastor who saved Jews from the Nazis does NOT count.

You have a really skewed way of looking at science, it almost sounds like you're anti-science. Some of your arguments sound like coming from a 12 year old Amish, sorry. It's pretty frustrating, because I have lots of respect for you and think you're a funny, creative and intelligent guy. Seeing you talk like that about the greatest human achievement ever really makes me sad.

14
Yes, just like variables, functions have to be declared before they are used.

15
GUIs are always on top of everything else.

16
As long as your syntax is messed up, AGS will complain about else. It is not redundant at all.
Code: Adventure Game Studio
  1. // example with single command:
  2.  
  3.   if (a < 0) Display("a is negative");
  4.   else if (a == 0) Display("a equals zero");
  5.   else Display("a is positive");
  6.  
  7. // code blocks
  8.  
  9.   if (walk_there_first) {
  10.     player.Walk(123, 45, eBlock);
  11.     player.FaceLocation(123, 44, eBlock);
  12.   }
  13.   else {
  14.     player.FaceLocation(mouse.x, mouse.y);
  15.   }

Btw, did you look at what I posted? No comment at all?

17
To make things a bit more tidy and readable, you can add this function at the bottom of the GlobalScript:

Code: Adventure Game Studio
  1. function MainGUIButton(GUIControl *control, MouseButton button) {
  2.   if (control == btnQuit) btnQuit_OnClick(control, button);
  3.   if (control == btnLoad) btnLoad_OnClick(control, button);
  4.   ...
  5. }
Now put "MainGUIButton" into every button's on click event field.

To run the button script, call MainGUIButton(btnLoad, eMouseLeft);
In a loop, use the Controls array element instead.

18
Phemar says you could add an argument to the function so you can use it like this:

  cEgo.Speak("Hello there!", aEgo0001);

where aEgo0001 is the sound you imported.
The big problem is that you cannot use the internal speech system ("&1 bla", auto-number speech lines, build voice script, speech.vox file, etc.), since this only works with Character.Say().

Which means you have to import all the speech files and name them yourself, then play them using standard audio commands.

Edit:
Ignore what I said, I assumed this is about non-blocking speech, but it's just about displaying text in a specific way.
The way to do this is to extract the &0?? part from the String and put it infront of the spaces used in the Say call. It's relatively simple and can be done by using String.indexOf and String.Substring.

19
Baron, so what are you saying: that we should stop all research, because it might have some bad implications...!?
You are redefining science as "policies about what we should and shouldn't do". You are free to oppose that, but don't call it science.
I don't care about a guy in a trench who is too stupid to understand the difference.

I don't think science can distance itself from such clearly implicit recommendations.
Yes it can. Science says how things are, not how they should be. But disregarding that for a moment: if we find out that there's an increased risk of getting skin cancer now, are we supposed to not make it public because our children are going to spend less time outside? I can't understand your view on this, not at all. It sounds like you desperately want to live in the past because you think everything used to be better (it wasn't).

You mentioned your relative with the umbilical cord around his neck. How was science causing that? According to you, science didn't want to prevent that. I don't know what's more ridiculous, the notion that science is an entity that can make decisions, or holding it responsible for what happened.

Both "science" and "god" are these all-powerful forces that can solve all your problems (in theory), but are just as equally likely to leave you stranded and disappointed in practice.  You may choose to believe in one or the other, and if that makes you feel more secure then so be it.  All I'm saying is that neither has convinced me, and that I still harbour doubts about both.
I don't even know what to say to this. It's not even wrong.

Edit:
Took a shower, cooled off a bit and decided to address one of the specific arguments.
Quote
Malaria, which is both preventable and treatable (according to Science) and yet it kills about 500 000 people every year!.
How is this the fault of science? As long as there are people who think homeopathy will help against Malaria, or who refuse treatment until it's too late, people will die from diseases like Malaria.
Also:
Quote
In the most severe cases of the disease, fatality rates can reach 20%, even with intensive care and treatment.
So again, how is this science's fault? HOW?

I also feel I have to address the "science is just another religion" part of your argument. Religions usually consist of three things: they provide a moral framework, they provide "facts" about the universe, and they tell the history of at least their part of the world. Science can only address the latter two; the first is where humanism comes in.
If people die of a cholera epidemic, it's not science's fault, it's the fault of people. Maybe there wasn't enough money, maybe help didn't get there fast enough. Pinning this on science is delusional.

20
The things you mention are fragments of reality. Religion has a lot of bearing on how the world we live in is. It influenced people's actions throughout centuries and is influencing them still. So that is religion's connection to reality. And in that sense religion is very much comparable to theoretical science.

But if you want me to compare religion directly to reality, it compares pretty much as any other piece of fiction describing reality to reality. And the theoretical/explanatory content of science is not that much different.
How? Why? Nothing of this makes sense. Are you saying that because religion still permeates society, it has some intrinsic value? Is this also true of the belief in witchcraft in Africa?
Are you seriously suggesting science is basically "just another religion"!?

The reason I wrote to you in the first place was your attack on Baron's well-founded advice to approach scientific theories with a healthy dose of skepticism. I imagine you must be some extreme materialist.
"Well-founded"? Not in the least. And please don't tell me you can't distinguish between a theory in the colloquial sense and a scientific theory.
I don't believe this. This ignorance about science is breathtaking.

Science is fundamentally different from religion. It seeks to eliminate personal bias. It follows the evidence wherever it leads.
If you think this means I blindly trust anything that claims to be scientific, and that people like me have basically replaced priests by people in lab coats, you are simply clueless.

Pages: [1] 2 3 ... 428