Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


    question about changing playerspeed in runtime

    Share

    easytoon
    Lucky
    Lucky

    Male
    Number of posts : 7
    Age : 32
    Job : Programer
    Message : Eva, auf Wiedersehen!
    Registration date : 2014-08-24

    question about changing playerspeed in runtime

    Post by easytoon on Sun Aug 24, 2014 6:50 pm

    there is a PLAYERSPEED definition inside wl_def.h,
    i can't change macro in runtime, any suggestions? Crying or Very sad

    AlumiuN
    Don't Hurt Me!
    Don't Hurt Me!

    Number of posts : 52
    Age : 24
    Location : Christchurch, New Zealand
    Registration date : 2013-08-31

    Re: question about changing playerspeed in runtime

    Post by AlumiuN on Mon Aug 25, 2014 12:49 am

    I believe that because it's a macro, the number will actually turn up multiple times in the EXE, so AFAIK there's no easy way to do it.

    easytoon
    Lucky
    Lucky

    Male
    Number of posts : 7
    Age : 32
    Job : Programer
    Message : Eva, auf Wiedersehen!
    Registration date : 2014-08-24

    Re: question about changing playerspeed in runtime

    Post by easytoon on Mon Aug 25, 2014 4:53 am

    @AlumiuN wrote:I believe that because it's a macro, the number will actually turn up multiple times in the EXE, so AFAIK there's no easy way to do it.
    even if you have any hard and long way to change the playerspeed in runtime i have to know about it  What a Face
    anyway maybe i shouldnt try to change the macro value because it Impossible (when compiling "RUNSPEED" is replaced with it's value (6000) any file that contains RUNSPEED will just get the value of RUNSPEED in the position of "RUNSPEED" REPLACE(code,"RUNSPEED",6000)



    Code:
    if(RUNSPEED>4000)
    will be:
    if(6000>4000)

      No 



    so even if i will try something like:
    Code:
    int *ptr;
    ptr = &RUNSPEED; //6000 :/ :(
    int buffer[1];
    buffer[0] = 20000;
    SIZE_T written;
    WriteProcessMemory(hProcess, ptr, (LPVOID)buffer, sizeof(buffer), &written);
     there is no pointer....
    BUT:
    there is have to be function that using runspeed value + function that using playerspeed value,
    what is the names of the functions that are using those values(6000,3000)?

    easytoon
    Lucky
    Lucky

    Male
    Number of posts : 7
    Age : 32
    Job : Programer
    Message : Eva, auf Wiedersehen!
    Registration date : 2014-08-24

    Re: question about changing playerspeed in runtime

    Post by easytoon on Mon Aug 25, 2014 6:47 pm

    i found a better way...(wl_act2) now it works...

    Sponsored content

    Re: question about changing playerspeed in runtime

    Post by Sponsored content Today at 9:44 pm


      Current date/time is Thu Dec 08, 2016 9:44 pm