Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SwingSpike

Pages: 1
1
that is impossible, because you cant do that by code.
what you can do however, is create a circular collision box. simply remove the box, and press "add circle", then adjust it to whatever you desire.

Thanks for confirming that. I must have added very good collision earlier using Polygons long time ago for some actors and forgot. For an actor i had both Box on the outside with Polygons on the inside. This is what caused me to misunderstand it by thinking that by placing a Box or a Circle that is larger than the image, it automatically bounds what is in it.

2
Sometimes i noticed that collision bounds editor in the Collision tab of an actor type doesn't add the collision bounds when i just Add Box. How do i make it create the collision bound around the image of the actor automatically ? I seen it happen at times.


3
I am happy to say that i found out a workaround solution after thinking a bit about the article you linked. I noticed the part about 0.1 decimal problem and realized that the problem in game was caused around 0.1 seconds. I changed it so that the timer is done close to 0.1 instead of going below it to 0.

I think it's very difficult for human's to distinguish the time gap between the split second between 0 and 0.1 when it's shown in a countdown timer, so i don't think it make any difference in the game. 

Seems like the computer's dumbness can be overcome by taking advantage of slow processing speed of humans.  :P

What are you actually trying to accomplish? I see that you're reducing a number using a timer, what's the end goal of doing that?

It was to show cooldown for an ability that needs to be used over and over again. It needed to be precise enough since ability cooldowns were low sometimes even below 1 second.

4
Computers are great at crunching numbers, but not perfect.
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems

Also, a number like "e-17" is scientific notation for a very large value.

Thanks. But how do i fix it ? I don't want to display that number when drawing the text and only want the right ones. It happens with only some numbers so i don't think i can find a logical fix for it.

5
So i was creating a game and i noticed a weird bug.

When i decrement a variable with a timer it shows a weird number for a quick second.

I created a simple program in which i was able to repeat this bug. It is attached here.
Note : This bug didn't cause any gameplay problem so far. It was just annoying since it showed the timer wrong for a quick second. I have tested out different solutions to rule out the assumption of a logical error. The number sometimes ends with letters like " e -17 ".etc.

6
Ok. Thanks everyone .   I just needed to know if there was a solution the way i hoped in the beginning. Seems like it's not possible. I will continue with the alternatives.

7
Quote
That is not a special event or something.
I know that's not directly available from all events as i fully checked it  before. Asked since i suspected it was possible to create something like that from Custom Code/Block (which i haven't learned to use so far) from the + Add Event.

Quote
With that I mean ANY way you can increase numA. You can use a timer to increment numA by 1 every 2, second (timed event), you can use a collision to increment numA by 1 (collision event)
numA is already something that keeps changing very fast. Just need numB to react to it instantly.

Setting up a code that decreases numB (Car Velocity) directly whenever numA (Turn Angle) is increased is like a hard-coded solution that solves the whole problem without timers, collisions or any new attributes to store the past values to check .

Is it possible to do like that ?

Quote
If you haven't done the second crash course, I recommend you to do that first to get basic understanding of using events.
It covers the very basics. Nothing like this is included in it.  I already know to setup all events except the ones in the Advanced Custom Events/Blocks.  I can setup most of the increment solutions with a bit of thinking.

I think i can find a solution if i attempt but i just wanted to know if it was possible through that simpler solution which is the premise of the thread.

8
Quote
if you want to change decrease numB the same amount as numA get's increased, use something like:
*whenever you increase numA*
increment numA with 1**
decrement numB with 1**
How do you setup something like ' whenever you increase numA' from the + Add Event ? That's all i would like to know.

9
So is there still a solution for the instant relative value change of two attributes which the thread was all about ?

Quote
if you are trying to get "realistic" a top down driving feeling, you shouldbe thinking in speeds, rather then velocity.
I went with velocity earlier since it looked more simple. I will try out and learn speed.

Quote
if this is the case, i could try to find my old topdown car behaviour which in my eyes worked pretty fine.
it has variables for acceleration, deceleration, steering speed, steering angle, and even wind resistance
That's very cool. It seems to be the same direction i am heading with my development. But all that together seems complicated for just now. I just need the solution for the instant attribute change problem for now.

It was my first thread, so i should have known to explain the game-wise idea first to give a clear picture for everyone.

10
Imagine a car that moves with a velocity 'v' towards direction 'a' which is an angle. Whenever the car makes a turn which changes the angle 'a' of the car by 1, velocity of the car needs to be reduced by 1. So whenever the car is turning it's velocity needs to be reduced instantly. In short, whenever 'a' is increased or decreased by 1, 'v' needs to be decreased by 1.

11
Thanks for the replies, everyone.

@mdotedote : The whole difficulty of the task lies in the timer. Tuning mathematically to get the result (the too fast or too frequent part you mentioned) using a millisecond timer is both tedious, requires a new attribute to check and also can still get wrong if the change is too fast which can all be avoided if the condition itself checks a change.

I think  all that it is required (if it exists which i want to know) is a forced condition which instantly decreases the attribute 'b' whenever the value of 'a' is increased with no respect to time.

Is timer the only way to check if the number value of an attribute has changed ?

I hope i was clear.  :-\

How do i use the drawing event instead of timer ? Just curious to know that too.

@sdieters : I think it's easy when you set the cause of the variable change like with that Enter Press and the followup increments. But is it possible to check the change in number value of an attribute like numA instead of the Enter Press ? For example, the attribute is something that is used in lots of places and whenever it's changed numB must change with respect to it. I think setting that counter is something that i could have comeup with on my own but didn't because of the last reason or could it be a solution ?

12
So i want to create a setup where changing an attribute 'a' for example when increased by 2 immediately decreases attribute 'b' by 1.

The solution that comes to my mind is by setting a millisecond timer and creating more attributes to store past values of both 'a' and 'b' to constantly check for change. (even this method is not perfect as it's not an instant change like something under 'Always' bracket)

The goal seems so basic so i wonder if there is an easy way to do it.

Pages: 1