« first day (981 days earlier)      last day (3310 days later) » 

20:00
fixing dryer. maybe later
if you want to work on some python while you wait, i need to figure out how to make @someonewithpc 's ray bounce more than once. latest .blend
Okay
On another note, 300 messages untli I hit 35k total messages in this room
@RadishBeavers Why don't you just run the script every logic tick?
20:17
@GiantCowFilms it is.
but idk how the script works, but it only bounces once
if you have another object mirror, it doesnot bounce
@RadishBeavers I see what the issue is
@GiantCowFilms Does that already
We need to recurse shoot
run it on the new vector
That's what I'm doing
I just didn't design it for that at the time
I'm adjusting it now
How do you pass a param when you run a python module?
20:25
If only there were a do-while in Python
@someonewithpc I wanna use recursion
@GiantCowFilms What parameter?
def shoot(self,vec):
is the new version of shoot I want to use
nvm, there is a work around
@GiantCowFilms Just do another function
figured that :)
@someonewithpc btw, why do you pass in self as the first param?
is that necessary?
20:27
Yes it is an implicit argument
I think a for loop will be better actually
more effcient
As opposed to a binding like in all other languages
mirror, location, normal = obj.rayCast(vec, None, 60)
hitObj, hitLocation, hitNormal = mirror.rayCast(reflectedVec, location, 60)
I feel like only one of those is needed?
your code isn't very clear
3 rep from 23
might start answering again
It first casts a ray from the emitter to the (possible) mirror
And then it casts a new ray from the hitLocation, in the direction of reflectedVec
20:31
and what does the second one do
But why twice
@GiantCowFilms Because it was designed to only use one mirror
I see
while True:
    mirror, location, normal = obj.rayCast(vec, None, 60)#, obj #, 0, "", 1, 0)
    #print(mirror, location, normal)
    if mirror != None:
        vec = vec.reflect(normal)
        print(mirror)
    else:
        print("no mirror found")
        break
That should work
but its not finding the second mirror
found my error
@RadishBeavers
import mathutils
import bge

game_objects = bge.logic.getCurrentScene().objects



def shoot(self):
    startVec = mathutils.Vector((0, 1, 0));
    obj = self.owner
    vec = mathutils.Vector((0, 1, 0)) #obj.localOrientation #
    sender = obj
    while True:
        mirror, location, normal = sender.rayCast(vec, None, 60)#, obj #, 0, "", 1, 0)
        #print(mirror, location, normal)
        if mirror != None:
            vec = vec.reflect(normal)
            print(mirror)
            sender = mirror
That should work
for any number of mirrors
The bge and game objects part are not needed
Only there cause I was testing
@GiantCowFilms That doesn't work
It only lists the morrors
20:37
what do you mean?
It produces the results I would expect.....?
Let me check something
@GiantCowFilms Never does it equal the last object
what do you mean?
It only does two mirrors!
sender = mirror
I think it works....?
I need more explination
It's only doing two for me
20:40
I'm not seeing it
@someonewithpc I noticed that
but I don't see why
@GiantCowFilms yes?
nvm
there is a bug
@someonewithpc is my PR guy
talk to him
llol
@someonewithpc Where is the bug?
It looks like it should work.....
20:41
@GiantCowFilms Not sure yet
Ah okay
so its not just me
But it is infinitely recursive
?
Where was the bug?
@someonewithpc That can happen
20:44
@GiantCowFilms For some reason, the vec is not the direction relative to the object, it is absolute
its pretty simple to check for
@someonewithpc What.
Yeah, I know
Meaning?
mirror, location, normal = sender.rayCast(sender.worldPosition + vec, None, 60)
Oops
I got into a recursion loop
I pointed a mirror back
so it goes into a loop
20:46
@GiantCowFilms Your code is weirdly factored
What do you mean?
Which is why I wanted a do-while
@GiantCowFilms Told you
Pretty easy to check for
@GiantCowFilms the if-else construct inside the loop
If the vector goes out the same way it comes in, we are going to end up in a loop
@someonewithpc It breaks, when the laser goes off into space
???
It breaks out of the loop when it doesn't find a mirror
you only get stuck in a loop if you shoot the ray back where it came...
20:48
do:
    #shoot ray
while mirror != None
Difference?
My code works
    else:
        print("no mirror found");
        break
no infinite loop
    import mathutils

    def shoot(self):
        startVec = mathutils.Vector((0, 1, 0));
        obj = self.owner
        vec = mathutils.Vector((0, 1, 0)) #obj.localOrientation #
        sender = obj
        while True:
            mirror, location, normal = sender.rayCast(sender.worldPosition + vec, None, 60)#, obj #, 0, "", 1, 0)
            #print(mirror, location, normal)
            if mirror != None and mirror.name.find("Mirror") != -1:
                vec = vec.reflect(normal)
                print(mirror)
@RadishBeavers ^^
@GiantCowFilms There is
I don't see it!
its not happening.
@someonewithpc Thats the same
20:52
@someonewithpc is that the finished code/?
@GiantCowFilms You said that as I just clicked that link on the sidebar :P
@RadishBeavers Should
Unless you or @GiantCowFilms find any bug
@someonewithpc Why is my code looping though
@someonewithpc There is one
so i just replace your old code with that?
20:53
@GiantCowFilms No, it's not
WHATS THE DIFFERECNE
you don't explain
@GiantCowFilms where?
you just keep saying "its wrong"
I check for the object name, so that it only reflects on mirros
but then you don't explain why
20:53
@GiantCowFilms I am...
@someonewithpc How does that avoid an infinite loop.....
@GiantCowFilms Because only objects named mirror should act as mirrors
1 min ago, by Radish Beavers
@GiantCowFilms where?
@someonewithpc Oh
You made it sound different
But there is a better way, @someonewithpc
@GiantCowFilms How?
@GiantCowFilms Which?
@someonewithpc Check if the vector reflecting goes back the same direction, its less work
20:57
@RadishBeavers Why? They're not frequently used, but it would fit for this ocasion
@GiantCowFilms No, that's worse
Then it's not universal
Your method cuases the ray to bounce all the way back to the start
@GiantCowFilms That would only work in the case where it lines up exactly
And I think I can find a way to get it into an infite loop anyway
20:58
And it would still reflect on non mirrors
@GiantCowFilms You use only mirrors, yeah
@GiantCowFilms idk.. never bothered
@someonewithpc Your code doesn't work
@GiantCowFilms No it doesn't, unless you only use mirrors
@GiantCowFilms Why?
@gandalf3 I managed in the end, I can even let you use it :)
@someonewithpc You can only have one object named mirror
@RadishBeavers sorry for not sending you the stuff yet. My siblings stole the computers. But I got the pillars done and a couple tile designs.

« first day (981 days earlier)      last day (3310 days later) »