Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,227 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Problem with origins, vectors and move (engl; de) #121307
04/03/07 23:48
04/03/07 23:48
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Hi,

once again me :-)

Have a question:

I thought it is possible, to move an entinity, or model into the .x vector of its origin.
Everytime i try this, the model moves into the .x direction of WED,

Maybe some has a hint for me?

Folgendes Problem,

ich will n model bewegen, und zwar ist es eigentlich ein statisches model, das sich ausgehend von seiner im MED erstellten origin bewegen soll. Leider tut es das nicht, es bewegt sich immer nur entlang der x achse vom WED, nich entlang der die ich ihm über MED gegeben hab.

Dachte das würde gehn.

Kann mir da jemand helfen?

Re: Problem with origins, vectors and move (engl; de) [Re: MikeS] #121308
04/04/07 00:27
04/04/07 00:27
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
Attach this action to an entity and it will move in its relative x direction
at the speed of time_step each frame, replace x with y or z to move in those directions.


Code:

action move_me
{
while(me)
{
my.x += time_step;
wait(1);
}
}



This does the same except moves with collision detection;
Code:


action move_me
{
while(me)
{
c_move(my, vector(time_step, 0, 0), nullvector, glide);
wait(1);
}
}



This does the same except uses the up and down cursor keys to move in x and -x.

Code:


action move_me
{
while(me)
{
c_move(my, vector((key_cuu-key_cud)*time_step, 0, 0), nullvector, glide);
wait(1);
}
}




Last example with all 4 cursor keys controlling x and y movement.
Code:


action move_me
{
while(me)
{
temp.x = key_cul-key_cur;
temp.y = key_cuu-key_cud;
temp.z = 0;
c_move(my, temp.x, nullvector, glide);
wait(1);
}
}





Not two, not one.
Re: Problem with origins, vectors and move (engl; de) [Re: Grafton] #121309
04/04/07 09:26
04/04/07 09:26
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Hmm,thanks,

but i still have a problem:

If i use
action move_me{ while(me) { my.x += time_step; wait(1); }}

it works for one direction.
But if i rotate the entity in WED, it still moves inthe same direction, not in thedirektion where its x axis is.

I need this to placethe same entity which shall be a button im able to press, more than one time and on different walls. but it allways shall move to its back.



Re: Problem with origins, vectors and move (engl; [Re: MikeS] #121310
04/04/07 10:24
04/04/07 10:24
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
You might want to read up on c_move.. it has two different vectors for movement: absolute and relative... I think one is for independently moving the object, and the other will move the object with its absolute movements intact, like a boat which you can drive around (absolute) but in an ocean current that adds its own movement on top of that (relative).

I think my.x just moved the entity according the the world's x axis, not the entity's. Someone else here can certainly answer it better than me, but I am pretty sure what u need is better suited towards c_move.. or? It's worth getting to know c_move if you are going to use 3DGS.

good luck anyway

Re: Problem with origins, vectors and move (engl; [Re: MikeS] #121311
04/04/07 10:26
04/04/07 10:26
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Thats because
my.x += any_value
moves the entity only on the x-axis of WED, no matter how it was rotated.

You could use this to get a non-collision but rotation dependent motion:
Code:

action move_me
{
while(me)
{
my.x += time_step * cos(my.pan);
my.y += time_step * sin(my.pan);

wait(1);
}
}


It is important to have both lines (my.x and my.y)!

Re: Problem with origins, vectors and move (engl; [Re: Xarthor] #121312
04/04/07 10:50
04/04/07 10:50
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
thxs Thunder, ill try it out.

K, thanks to Thunder, it worked.

thx

Last edited by MikeS; 04/04/07 12:47.
Re: Problem with origins, vectors and move (engl; [Re: MikeS] #121313
04/05/07 00:36
04/05/07 00:36
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
Thunder is correct, my.x is an absolute direction, sorry about that. I was trying to start with an absolutely basic example and build up. You would rarely move an entity such as a player with "my.x" I shouldnt have included it. Too bad you picked that very first one to judge my entire series of examples with

The rest of the examples are correct and will move the entity in relative vectors with collision detection.

Re: Problem with origins, vectors and move (engl; [Re: Grafton] #121314
04/05/07 08:02
04/05/07 08:02
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Hmm,
i dontknow if its a real prob, or its my pc, atm i have the problem, that thunders code is working, but only sometimes.....

What happens, i have attached myscript, gave the entity theaction,compile, and rn thelevel,everything is fine,t works how i want. But if i start the level later (worked a little bit on it) the same script with the same entities does no longer work. Ame is with defined skills, first i see the definded skill names, at a later time i dont see them anymore.

Is it a bug, or my pc is too hot, or whats wrong?

Im using the free trial version at the moment.

Anny suggestions?

Oh, an Josiah, thanks for ur posts too.

I first tried it myself with c_move, but it didnt work, then i tried it with thunders code, it worked, and now, it does no longer work. maybe if i try it today morning it may work again,who knows :-(.

Re: Problem with origins, vectors and move (engl; [Re: MikeS] #121315
04/05/07 08:20
04/05/07 08:20
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@MikeS:
Sounds very strange, however I remember having a similiar problem once.
I don't know how I solved it, a solution you could try is to create a new .wdl file copy the code into it and save it with a different name and include the new file instead of the old.
However I can barely imagine that this will solve your problem.

About the WED related thing (seeing defined skills or not):
Open your level in WED and go to "File -> Preferences -> Advanced -> Reload of externally modified files: Auto"

About the c_move thing:
It might work with c_move if you set my.passable = on;

Re: Problem with origins, vectors and move (engl; [Re: Xarthor] #121316
04/05/07 13:31
04/05/07 13:31
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
I think i know what problem i have, but i cant solve it:

WED does not update any changes in script, or he does only sometimes.

if i change the script with File--> Map Properties .....
he still runs the old script, not the new attached.
How do i know? I put an beep in the first script, and no beep in the second, both scripts do have the same code, expect the beep. And yes, both have different names.

I dont know what to do.

Maybe anyone has an idea.

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