Gamestudio Links
Zorro Links
Newest Posts
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
ZorroGPT
by TipmyPip. 10/26/26 08:09
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (opm, 1 invisible), 14,409 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: RPG game movement [Re: 3run] #430579
09/29/13 09:03
09/29/13 09:03
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
You're wrong that you got nothing in these forums.
First, you got some helpful links to learn from.
And next, I gave you everything you need laugh
Target (if you search the manual) defines coordinates after a c_trace or other functions (c_trace is what you need in the example) , vec_for_screen you need to convert the screen coordinates. Everything else you can learn in the first tutorials...
Not tested, but here's what I mean:

Code:
function player_act()
{
    var tempcoord[3];
    var tempcoord2[3];
    while(1)
    {
        if(mouse_left == 1)
        {
            tempcoord[0] = mouse_pos.x;  // get pos infront of camera
            tempcoord[1] = mouse_pos.y;
            tempcoord[2] = 0;
            vec_for_screen(tempcoord[0],camera);

            tempcoord2[0] = mouse_pos.x;  // get pos far from camera
            tempcoord2[1] = mouse_pos.y;
            tempcoord2[2] = 5000;
            vec_for_screen(tempcoord2[0],camera);

            c_trace(tempcoord[0], tempcoord2[0], USE_POLYGON );  // trace between the two positions
            if(result > 0)  // if trace hit
            {
                if(vec_dist(my.x, target.x) > 40)  // if distance from player is more than 40 quants
                {
                    vec_set(tempcoord[0], target.x);  // get my target direction
                    vec_sub(tempcoord[0], my.x);
                    vec_to_angle(my.pan, tempcoord[0]);  // rotate me to my target
                    my.tilt = 0;
                    my.roll = 0;
                    c_move(me, vector(10 * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE );  // move me towards target
                }
            }
        }
        wait(1);
    }
}



With some while statements (for example while(vec_dist() > 40) ) you can make the player go without holding mouse_left, or combine both methods into one.

So, dont you agree I gave you everything in my first post? You just need to look in the manual about the needed functions, that I posted about. laugh
I have 14 years of experience and I never remember what the functions need as parameters, I constantly go through the manual...You just need to memorize what functions are available...It takes time.

PS.: I'm still new to Lite-C, but this example is identical to my implementation, wich runs without errors. I dont know yet how to define a VECTOR so I used a var in my example. I think c_trace, c_move and vec_for_screen should be the same as in Lite-C...

Last edited by EpsiloN; 09/29/13 09:06.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: RPG game movement [Re: EpsiloN] #430699
09/30/13 23:40
09/30/13 23:40
Joined: Sep 2013
Posts: 5
R
richardb Offline OP
Newbie
richardb  Offline OP
Newbie
R

Joined: Sep 2013
Posts: 5
Ty i can get more usefull info from your last post , thanks allot. i didnt know what trace was in c-Lite but i see it now.

Re: RPG game movement [Re: richardb] #430770
10/01/13 19:02
10/01/13 19:02
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Here is the thing you need to learn , no example will teach you anything if you cannot yet grasp theterminology (exscuse my bad spelling) ,invest your time to disect anything you do not understand , let me tell you a story , i was i child and never saw a computer and what a computer was for i had no idea ! My very first experience with a computer was basic programming , i accidently studied the help files for basic coding , not knowing what it was i thought this is the stuff that teaches you how to work with a pc (ofcourse there werent windows back then and a mouse was actualy high tech to me) but damn i studied every g.damn command and knew exactly by memmory what it did , before long i was coding games and fake virus reports , menus and password protection for pcs , after that actual "fuck some ones shit up" without second chances code... Anyway i could code the shit out of pascal before i even reached the actual grade in school where it became available as a school subject to me , i went on to c++ and other languages again studied it all myself and i can tell you now that if you really want to learn only time and dedication will get you anywhere , lots of questions and try to put every idea you have into actual code , i did not have the internet back then all i had was library and my pc ...if i could learn so could you BUT you wont find magical manuals and examples because when it comes to coding the possibilities are endless . Just dont throw your life away chasing dreams


Compulsive compiler
Re: RPG game movement [Re: Wjbender] #430773
10/01/13 19:34
10/01/13 19:34
Joined: Jul 2013
Posts: 158
F
Feindbild Offline
Member
Feindbild  Offline
Member
F

Joined: Jul 2013
Posts: 158
Shit bro, you got some serious issues.

Re: RPG game movement [Re: Feindbild] #430774
10/01/13 19:47
10/01/13 19:47
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Just laughing , dude dont we all


Compulsive compiler
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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