Wolf3d Haven Forum

Please log in or register. Smile

Join the forum, it's quick and easy

Wolf3d Haven Forum

Please log in or register. Smile

Wolf3d Haven Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Wolf3d Haven Forum

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


2 posters

    question about changing playerspeed in runtime

    avatar
    easytoon
    Lucky
    Lucky


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

    question about changing playerspeed in runtime Empty question about changing playerspeed in runtime

    Post by easytoon 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
    AlumiuN
    Don't Hurt Me!
    Don't Hurt Me!


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

    question about changing playerspeed in runtime Empty Re: question about changing playerspeed in runtime

    Post by AlumiuN 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.
    avatar
    easytoon
    Lucky
    Lucky


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

    question about changing playerspeed in runtime Empty Re: question about changing playerspeed in runtime

    Post by easytoon 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)?
    avatar
    easytoon
    Lucky
    Lucky


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

    question about changing playerspeed in runtime Empty Re: question about changing playerspeed in runtime

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

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

    Sponsored content


    question about changing playerspeed in runtime Empty Re: question about changing playerspeed in runtime

    Post by Sponsored content


      Current date/time is Thu Nov 21, 2024 6:40 am