is this a bug or is it me???

Non-platform specific questions.

is this a bug or is it me???

Postby sonicfire » Sat May 28, 2011 3:17 pm

can anybody help me? please check the attached game demo.
you can move the player via the arrow keys which works fine.

however! try using the onscreen arrows (click them).
you will see the player isnt moving at all?? why?
i´m triggering the SAME function - so he should move, no ??

this is so weird, can anybody help me?? please ? :)

mrtwo.rar
(247.49 KiB) Downloaded 86 times
Attachments
screeny.jpg
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: is this a bug or is it me???

Postby savvy » Sat May 28, 2011 4:06 pm

why are you using such a scew-iff way of doing this? lol just use a direction variable, then on the player use if animindex!= to change its animation. using void for this is a really awkward thing to do. so yeah, just use a variable instead of the void function and it should work perfectly.

savvy
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: is this a bug or is it me???

Postby sonicfire » Sat May 28, 2011 4:11 pm

perhaps you´re right :oops:
just tried the movecode directly upon mouse button down instead of putting it into a function ... and guess what, player moves correctly.
i still only dont understand why it did not work before :?
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: is this a bug or is it me???

Postby savvy » Sat May 28, 2011 4:28 pm

perhaps the switch wasnt working properly :P
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: is this a bug or is it me???

Postby skydereign » Sun May 29, 2011 1:09 am

Okay, chances are it is the global code actor variable problem. Essentially global code can't access other actor's actor variables unless the event code has some reference to the actor. For example, this will not turn the player actor red.
Global Code
Code: Select all
void
colorActor ()
{
    player.r=0;
    player.g=0;
    player.b=0;
}


view -> KeyDown r (disabled) -> Script Editor
Code: Select all
colorActor();


But this code will.

view -> KeyDown r (disabled) -> Script Editor
Code: Select all
// player
colorActor();


So if you use any instances of actorName.actorVar it won't work unless in the event that calls the global code you reference actorName in some way. I can't tell if that is the case here as the file I guess was emptied, but that might be the problem you are having.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: is this a bug or is it me???

Postby sonicfire » Sun May 29, 2011 1:03 pm

ah, i remember! that was the problem i once had also... thanks!! :)
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest