Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (RealSerious3D, AndrewAMD, BrainSailor, 1 invisible), 1,233 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Why does this not work? #77574
06/13/06 16:03
06/13/06 16:03
Joined: Jun 2006
Posts: 14
P
Perkele Offline OP
Newbie
Perkele  Offline OP
Newbie
P

Joined: Jun 2006
Posts: 14
I took this script straight from the manual and tried it out. It should move my entity along either the X-axis or Y-axis but unfortunately I found that it doesn't do anything to my entity and the only thing that moves when pressing the arrowkeys is the camera.

Code:
 
action move_me
{
while (1)
{
my.X += 10 * KEY_FORCE.X;
my.Y += 10 * KEY_FORCE.Y;
move_view();
wait(1);
}
}



Re: Why does this not work? [Re: Perkele] #77575
06/13/06 17:08
06/13/06 17:08
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
1. did you assign the action to the entity, resave the level and build-> update entities?

2. do you ALSO have the camera scripted to move based on cursor key inputs someplace in your script as well?

Re: Why does this not work? [Re: Grimber] #77576
06/13/06 18:22
06/13/06 18:22
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
3. did you run the level by clicking on RUN ?

Re: Why does this not work? [Re: Xarthor] #77577
06/14/06 15:03
06/14/06 15:03
Joined: Jun 2006
Posts: 14
P
Perkele Offline OP
Newbie
Perkele  Offline OP
Newbie
P

Joined: Jun 2006
Posts: 14
1. Yes I assigned it.
2. No, I only have the move code, nothing else.
3. Yes, of course

Re: Why does this not work? [Re: Perkele] #77578
06/14/06 20:10
06/14/06 20:10
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
it doesn't have anything to detect that the key is being pressed so ofcourse it doesn't work.


Wait, there isn't a "Make My Game Now" button?
Re: Why does this not work? [Re: Bot190] #77579
06/14/06 20:26
06/14/06 20:26
Joined: Jan 2003
Posts: 1,738
Nashua New Hampshire
anonymous_alcoho Offline
Senior Developer
anonymous_alcoho  Offline
Senior Developer

Joined: Jan 2003
Posts: 1,738
Nashua New Hampshire
Not true. Key_force detects the keyboard. Key_force = 0 as long as the key is not pressed. When the engine detects the button being pressed, a value is assigned to key force. This is why it is in a while loop, so it can continually check for the arrow key to be pressed.

I got it to work for me. Did you try pressing F7 to change the camera view?

Also, after I plugged in the script and got it working, i found it had to be modified slightly. Key_force.x and .y were in the wrong spots and the .y had to be reversed

Code:

action move_me
{
while (1)
{
my.X += 10 * KEY_FORCE.Y;
my.Y -= 10 * KEY_FORCE.X;
move_view();
wait(1);
}
}



You are using templates right?


"Oh no, it's true! I'm a love magnet!" Calvin from Calvin and Hobbes My name's Anonymous_Alcoholic.
Re: Why does this not work? [Re: anonymous_alcoho] #77580
06/14/06 20:29
06/14/06 20:29
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
he said thats it no other code.


ps. it wouldn't load a level so of course it doesn't work.


Wait, there isn't a "Make My Game Now" button?
Re: Why does this not work? [Re: Bot190] #77581
06/14/06 20:31
06/14/06 20:31
Joined: Jan 2003
Posts: 1,738
Nashua New Hampshire
anonymous_alcoho Offline
Senior Developer
anonymous_alcoho  Offline
Senior Developer

Joined: Jan 2003
Posts: 1,738
Nashua New Hampshire
then how does move_view() work?

Make sure freeze_mode is set to 0 and not 1. I made this mistake

Also, you can try this variation:

Code:
 
action move_me
{
while(1)
{
my.x += 10 * (key_cuu - key_cud);
my.y -= 10 * (key_cul - key_cur);
camera.pan = my.pan;
camera.x = my.x - 150;
camera.y = my.y;

wait(1);
}
}

Does the same exact thing. Only F7 won't affect it.


"Oh no, it's true! I'm a love magnet!" Calvin from Calvin and Hobbes My name's Anonymous_Alcoholic.
Re: Why does this not work? [Re: anonymous_alcoho] #77582
06/14/06 20:35
06/14/06 20:35
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
it doesn't. i had to comment it out.


Wait, there isn't a "Make My Game Now" button?
Re: Why does this not work? [Re: Bot190] #77583
06/14/06 21:24
06/14/06 21:24
Joined: Jun 2006
Posts: 14
P
Perkele Offline OP
Newbie
Perkele  Offline OP
Newbie
P

Joined: Jun 2006
Posts: 14
Well I'm quite new so I'm not sure what exact steps to follow, but I just made a map, then through map properties I assigned my Script02.wdl which contained nothing but the code I pasted before.
And all it does is move my camera...

Page 1 of 2 1 2

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