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

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    1. Announcements

    2. Support

    3. Suggestions

[Q] Togglable Ragdoll Mode


SaintJimmy

Recommended Posts

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.

Link to post
Share on other sites

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
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
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
Link to post
Share on other sites

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?

Link to post
Share on other sites

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

 

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

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

Link to post
Share on other sites

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.

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
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)

 

Link to post
Share on other sites

 

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
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!

Link to post
Share on other sites

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

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?

Link to post
Share on other sites

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.

Link to post
Share on other sites

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
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 ^^)

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.

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

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

 

 

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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