Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
SaintJimmy

[Q] Togglable Ragdoll Mode

Recommended Posts

HippieCommunist

sry double bumping post whatsthat.gif

 

calling all LUA experts to make this one a bounty

Share this post


Link to post
Share on other sites
Ricksta
yeah ive been trying all day

 

here is my code

 

 

PLAYER_ID, PLAYER_INDEX, PLAYER_CHAR, SAVEDONE, TIMER = 0function InitScript()-- blah-blah-blahWait(10000)endfunction WaitForPlayerPoolCreation()while (IsPlayerPoolCreated() == 0) do  Wait(2000)endendfunction WaitForValidPlayer()PLAYER_CHAR = 0repeat  CallNative("GET_PLAYER_ID")PLAYER_ID = GetIntResult()if (PLAYER_ID >= 0) then PushInt(PLAYER_ID) CallNative("CONVERT_INT_TO_PLAYERINDEX") PLAYER_INDEX = GetIntResult() PushInt(PLAYER_INDEX)    PushVarPtr() CallNative("GET_PLAYER_CHAR") PLAYER_CHAR = GetIntParam(1) if (PLAYER_CHAR <= 0) then   Wait(1000) end  enduntil (PLAYER_CHAR > 0)  endfunction start() PushInt(PLAYER_CHAR) PushInt(1) PushInt(65534) PushInt(1) PushInt(1) PushInt(1) PushInt(0) CallNative("SWITCH_PED_TO_RAGDOLL")Wait(30) PushInt(1) PushInt(79) CallNative("CREATE_NM_MESSAGE") PushInt(1) PushInt(95) CallNative("SET_NM_MESSAGE_BOOL") PushInt(85) PushInt(65535) CallNative("SET_NM_MESSAGE_INT") PushInt(PLAYER_CHAR) CallNative("SEND_NM_MESSAGE") PushInt(PLAYER_ID) PushInt(1) CallNative("GIVE_PLAYER_RAGDOLL_CONTROL")endfunction stop() PushInt(PLAYER_CHAR) CallNative("CLEAR_CHAR_TASKS") PushInt(0) PushInt(79) CallNative("CREATE_NM_MESSAGE") PushInt(PLAYER_CHAR) CallNative("SEND_NM_MESSAGE") PushInt(PLAYER_CHAR) PushInt(0) CallNative("SWITCH_PED_TO_ANIMATED") PushInt(PLAYER_CHAR) PushInt(PLAYER_ID) PushInt(0) CallNative("GIVE_PLAYER_RAGDOLL_CONTROL")Wait(100)endfunction main()InitScript()while true do WaitForPlayerPoolCreation()    WaitForValidPlayer()    if (IsKeyPressed(34) == 1) thenstart()Wait(300)end    if (IsKeyPressed(33) == 1) thenstop()Wait(300)endWait(300)endend-- startmain();

 

 

press PGDN to ragdoll drunk

press PGUP to get up

it makes niko drunk balanced while ragdolled but it only works if player is idle (holding the phone before u press PGDN helps load anims maybe)

 

-also notice that the function (switch to ped) returns a value, probably the is_ped_ragdoll.

theres a pop after the line is called

don't work for me sad.gif

crashes to desktop when i press pageup, All I have is the ragdoll lua in alice folder.

Share this post


Link to post
Share on other sites
HippieCommunist

i dunno why but i think that Alice 0.1 cant deal with animations/models yet

Share this post


Link to post
Share on other sites
GAK

I think SWITCH_PED_TO_RAGDOLL can work but it's crash too.

 

I think we should wait Alice 0.2 maybe solve some problems or find why it's crash.

 

 

PushInt(PLAYER_CHAR)

CallNative("CLEAR_CHAR_TASKS")

 

This could solve the crash, I will try.

Edited by GAK

Share this post


Link to post
Share on other sites
HippieCommunist

nah man spare it

 

i tought it was because the AMBIENT_ANIMS so i blocked them and all the gestures and lookvise stuff aswell.... still crash on the native SWITCH PED

 

to save u the time i tried the CLEAR TASK IMMEDIATLY aswell

Edited by HippieCommunist

Share this post


Link to post
Share on other sites
SaintJimmy

Come on scripters...BRAINSTORM!

Share this post


Link to post
Share on other sites
HippieCommunist

thats what im saying...

 

now look some idiot's gonna write his stupid off-topic request or find a brilliant reason why this is a-bad-idea-mod... sneaky2.gif

 

where are the legends?

even the creator of Alice dont have a clue, i pmed him.

Edited by HippieCommunist

Share this post


Link to post
Share on other sites
GAK

In playboy3.sco there's : SWITCH_PED_TO_RAGDOLL(L[950][var0 * 39].v0, 0, 60000, 1, 1, 1, 0)

 

But this example also crash.

Nobody remembers a mission where an NPC or the player switch to ragdoll?

Share this post


Link to post
Share on other sites
pedrus

Hello, what are the parameters of the native "APPLY_FORCE_TO_PED" plz?

 

The used_natives_params.txt say that there is 12 parameters!!!

Share this post


Link to post
Share on other sites
HippieCommunist

yeah thats coz u need 3d direction of force (vector = 2 points+) and all the other flags...

 

theres the climing the truck mission where niko has alot of RD action

Share this post


Link to post
Share on other sites
GAK

I find an example of SWITCH_PED_TO_RAGDOLL_WITH_FALL :

 

SWITCH_PED_TO_RAGDOLL_WITH_FALL(L[3405][14], 2200, 5000, 1, (float)1, -0.0f, 0.0f, 1.75f, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0)

 

I have not even tried, I'll keep you informed.

Share this post


Link to post
Share on other sites
HippieCommunist

thats crap! nothing works!

Share this post


Link to post
Share on other sites
sk8er_martz

 

Nobody remembers a mission where an NPC or the player switch to ragdoll?

Going to the bar gets you drunk (euphoria's animated ragdoll) and then after a bit brings you back to normal so see if there's anything in activities.

 

The latest script posted now worked for me ONCE, it crashes the rest of the time but when it worked it was perfect, I really like how you have to press a button to get up again so he doesn't do it automatically.

 

If you guys have gotten that far then surely this will be done and dusted soon.

 

Hopefully additional things could be done too like being able to jump while in the drunk state (not the crappy animation) and maybe even holding onto things like cars or buildings, that'll be awesome, but right now the current script is great, apart from the extremely low success rate.

 

Keep up the good work! I've been hoping for this mod ever since I got drunk on the PS3 version and I didn't expect it to come this soon.

Edited by sk8er_martz

Share this post


Link to post
Share on other sites
HippieCommunist

another funny thing ive noticed that if you enter only 6 params (without the last 0) the success rate goes up alittle (littttle)

something diffrent about how the PLAYER_CHAR is proccesed in the original DRUNK script,

i even sent my latest script to Alexander Blade so fingers crossed, hope the problem is simple (since it does work scripwise).

 

btw @sk8er_martz - my script has the get up function working great (PGUP)

 

Share this post


Link to post
Share on other sites
pedrus

 

yeah thats coz u need 3d direction of force (vector = 2 points+) and all the other flags...

 

theres the climing the truck mission where niko has alot of RD action

Ok but where I can find an example ? because I don't know how the parameters (or flags) are organized.

 

Edit:

 

 

btw @sk8er_martz - my script has the get up function working great (PGUP)

Where is it? I need it!!!

Edited by pedrus

Share this post


Link to post
Share on other sites
ManiaChris
yeah ive been trying all day

 

here is my code

 

 

PLAYER_ID, PLAYER_INDEX, PLAYER_CHAR, SAVEDONE, TIMER = 0function InitScript()-- blah-blah-blahWait(10000)endfunction WaitForPlayerPoolCreation()while (IsPlayerPoolCreated() == 0) do  Wait(2000)endendfunction WaitForValidPlayer()PLAYER_CHAR = 0repeat  CallNative("GET_PLAYER_ID")PLAYER_ID = GetIntResult()if (PLAYER_ID >= 0) then PushInt(PLAYER_ID) CallNative("CONVERT_INT_TO_PLAYERINDEX") PLAYER_INDEX = GetIntResult() PushInt(PLAYER_INDEX)    PushVarPtr() CallNative("GET_PLAYER_CHAR") PLAYER_CHAR = GetIntParam(1) if (PLAYER_CHAR <= 0) then   Wait(1000) end  enduntil (PLAYER_CHAR > 0)  endfunction start() PushInt(PLAYER_CHAR) PushInt(1) PushInt(65534) PushInt(1) PushInt(1) PushInt(1) PushInt(0) CallNative("SWITCH_PED_TO_RAGDOLL")Wait(30) PushInt(1) PushInt(79) CallNative("CREATE_NM_MESSAGE") PushInt(1) PushInt(95) CallNative("SET_NM_MESSAGE_BOOL") PushInt(85) PushInt(65535) CallNative("SET_NM_MESSAGE_INT") PushInt(PLAYER_CHAR) CallNative("SEND_NM_MESSAGE") PushInt(PLAYER_ID) PushInt(1) CallNative("GIVE_PLAYER_RAGDOLL_CONTROL")endfunction stop() PushInt(PLAYER_CHAR) CallNative("CLEAR_CHAR_TASKS") PushInt(0) PushInt(79) CallNative("CREATE_NM_MESSAGE") PushInt(PLAYER_CHAR) CallNative("SEND_NM_MESSAGE") PushInt(PLAYER_CHAR) PushInt(0) CallNative("SWITCH_PED_TO_ANIMATED") PushInt(PLAYER_CHAR) PushInt(PLAYER_ID) PushInt(0) CallNative("GIVE_PLAYER_RAGDOLL_CONTROL")Wait(100)endfunction main()InitScript()while true do WaitForPlayerPoolCreation()    WaitForValidPlayer()    if (IsKeyPressed(34) == 1) thenstart()Wait(300)end    if (IsKeyPressed(33) == 1) thenstop()Wait(300)endWait(300)endend-- startmain();

 

 

press PGDN to ragdoll drunk

press PGUP to get up

it makes niko drunk balanced while ragdolled but it only works if player is idle (holding the phone before u press PGDN helps load anims maybe)

 

-also notice that the function (switch to ped) returns a value, probably the is_ped_ragdoll.

theres a pop after the line is called

Doesn't work for me too - crash!

Share this post


Link to post
Share on other sites
HippieCommunist

O RLY!? orly.gif

 

lol

Share this post


Link to post
Share on other sites
pedrus

If you replace "PushInt(PLAYER_ID)" by "PushInt(PLAYER_INDEX)" PgDwn works (Niko is drunk but never get up) and PgUp crash.

Share this post


Link to post
Share on other sites
sk8er_martz
If you replace "PushInt(PLAYER_ID)" by "PushInt(PLAYER_INDEX)" PgDwn works (Niko is drunk but never get up) and PgUp crash.

Which "PushInt(PLAYER_ID)" ?

 

I replaced all of them but it crashed like usual when I pressed PgDown.

 

If you can get that to work all the time and the normal script has PgUp working all the time, couldn't you remove the other button from each of the scripts and run them seperately?

Share this post


Link to post
Share on other sites
pedrus

There is two "PushInt(PLAYER_ID)". I replaced both and it worked (only PgDwn) something like 3 times but now it crash when I press PgDwn... suicidal.gif .

 

 

PgUp always crashed my game.

Share this post


Link to post
Share on other sites
HippieCommunist

yeah it makes no sense the buggy line is SWITHC_PED_TO_RAGDOLL not the one with the ID... confused.gif

Share this post


Link to post
Share on other sites
pedrus

How do you see where are errors?

 

Sry for stupid questions but I'm really interested in making lua script for GTA. I want to know all I need to know about lua and natives etc...

Edited by pedrus

Share this post


Link to post
Share on other sites
HippieCommunist

ok guys we got an update

 

almost positive confirmation about the function (SWITCH_PED) not bein' called propertly yet, the good news is that Alice 0.2 is on the way and its gonna support specific functions like such inlove.gif

 

in case any of u are still trying....

just sit tight (animated for now ^^)

Share this post


Link to post
Share on other sites
HippieCommunist

so what your idea? spawn two cars to crush niko real fast and disappear? ^_^

Share this post


Link to post
Share on other sites
lasallup

no way to assign the "got shot" action to a key so when you press it you get shot and go into ragdoll?

Share this post


Link to post
Share on other sites
HippieCommunist

perhaps only if ure being shot by a water stream... dozingoff.gif so no damage would be taken

Share this post


Link to post
Share on other sites
sk8er_martz

 

perhaps only if ure being shot by a water stream...  dozingoff.gif so no damage would be taken

Perhaps spawn an invisible water stream from the camera's point of view aiming at the player turn.gif

 

Although it'd be easier to just trigger whatever happens when someone is hit by a water stream from a fire truck or whatever, which I'm assuming is what the latest script tries anyway.

Share this post


Link to post
Share on other sites
HippieCommunist

maybe with the C++ thinggy the switch ped to ragdoll wont crash?

 

i dont know what to do with the source tough, its not just saving as DLL in notepad lol.gif

Share this post


Link to post
Share on other sites
sjaak327
maybe with the C++ thinggy the switch ped to ragdoll wont crash?

 

i dont know what to do with the source tough, its not just saving as DLL in notepad lol.gif

You need to compile the source with VS 2008 smile.gif

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 1 User Currently Viewing
    0 Members, 0 Anonymous, 1 Guest

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.