Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    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. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. 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. Red Dead Redemption 2

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

    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
    1. Announcements

    2. Forum Support

    3. Suggestions

[GTAIV|REL] A l i c e


Alexander Blade
 Share

  • Replies 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

  • aceship

    107

  • Alexander Blade

    94

  • Marcin6

    63

Top Posters In This Topic

Recommended Posts

Alexander Blade

alice doesn't support vector3 (pointer to 3 floats?) now because i didn't know about it

Link to comment
Share on other sites

Alexander Blade

i can add vector3 support via alloc/write/read mem commands

only u'll need for v3 pointer - push address of allocated mem

it's k ?

Link to comment
Share on other sites

i can add vector3 support via alloc/write/read mem commands

only u'll need for v3 pointer - push address of allocated mem

it's k ?

If you mean using the Alice pre-2.0 syntax "PushVarPtr()" then yes, that will work.

 

Allocate the table, and initialize it.

Push the address of the table (or 2 tables or 3 tables) - some native functions use more than one vector3.

Call the native function (using the older syntax - CallNative("do_Something") ?)

The returned vector3 should be available directly from the Lua table using the standard Lua syntax.

 

I don't know whether all the native functions that use a vector3 return only float values, although I think they do. I don't know if that is a problem, maybe not.

 

From what you've said I'm guessing that the high level syntax "do_Something(ped, vector3, vector3)" can't be made to work because Alice can't allocate the memory for the vector3 from that syntax?

 

Or, do you mean that we can use the high level syntax but must first explicitly allocate the vector3 memory space and then pass the address in the high level call?

 

Any way that actually works will be more than acceptable. And, thank you.

 

I would have thought this would work:

 

local vector_1 = {f(1.00), f(1.00), f(1.00)}local vector_2 = {f(1.00), f(1.00), f(1.00)}do_Something(CHAR_ID, vector_1, vector_2)-- get the individual vectorsv1_1 = vector_1[1]; v1_2 = vector_1[2]; v1_3 = vector_1[3];v2_1 = vector_2[1]; v2_2 = vector_2[2]; v2_3 = vector_2[3];

 

I don't know how Lua internally handles tables but I thought that "vector_1 = {f(1.00), f(1.00), f(1.00),}" allocated the memory space. Then the Alice high level syntax just needs to pass the address of the table.

Edited by zBobG
Link to comment
Share on other sites

  • 2 weeks later...

Can somebody fix this script ? I using it to reapir vehicles and sometimes i get CTD dont know why .

--globale variablen

PLAYER_ID, PLAYER_INDEX, PLAYER_CHAR, PLAYER_CAR, SAVEDONE, TIMER = 0

 

function InitScript()

-- Wake up neo ... wake up ....wink.gif

Wait(10000)

end

 

function WaitForPlayerPoolCreation()

while (IsPlayerPoolCreated() == 0) do

Wait(2000)

end

end

 

function WaitForValidPlayer()

PLAYER_CHAR = 0

repeat

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

end

until (PLAYER_CHAR > 0)

end

 

function getPlayerCar()

PLAYER_CAR = 0

IN_CAR = 0

repeat

PushInt(PLAYER_CHAR)

CallNative("IS_CHAR_IN_ANY_CAR")

IN_CAR = GetIntResult()

if(IN_CAR > 0) then

PushInt(PLAYER_CHAR)

PushVarPtr()

CallNative("GET_CAR_CHAR_IS_USING")

PLAYER_CAR = GetIntParam(1)

end

if (PLAYER_CAR <= 0) then

Wait(1000)

end

until (PLAYER_CAR > 0)

end

 

function repairCar(playerCar)

PushInt(playerCar)

CallNative("FIX_CAR")

Wait(300)

end

 

function main()

InitScript()

while true do

WaitForPlayerPoolCreation()

WaitForValidPlayer()

-- F1 -----------------------------

if (IsKeyPressed(112) == 1) then

getPlayerCar()

if PLAYER_CAR > 0 then

repairCar(PLAYER_CAR)

end

end

Wait(500)

end

end

main();

Link to comment
Share on other sites

Alexander Blade

try to use high level calling

Link to comment
Share on other sites

try to use high level calling

yyy what ?? Sorry but i dont know what you mean and this is not my lua script ....

 

And can you create carspawn for more slots ?

Link to comment
Share on other sites

Alexander Blade

for example

if (IS_CHAR_IN_ANY_CAR(PLAYER_CHAR) == 1) then

blah

end

 

atleast now i have some free time and i wanna to finish binding delphi-builded script plugins for alice

Link to comment
Share on other sites

for example

if (IS_CHAR_IN_ANY_CAR(PLAYER_CHAR) == 1) then

blah

end

 

atleast now i have some free time and i wanna to finish binding delphi-builded script plugins for alice

Sorry but i really dont know what to do .

Well if you have a free time please check this carfix script and fix something , and one thing . I trying to add more slots to carspawn

if (IsKeyPressed(90) == 1) -- z + 1..8

then

WaitForPlayerPoolCreation()

WaitForValidPlayer()

Wait(100)

if (IsKeyPressed(49) == 1) then SpawnCar("banshee") end

if (IsKeyPressed(50) == 1) then SpawnCar("huntley") end

if (IsKeyPressed(51) == 1) then SpawnCar("oracle") end

if (IsKeyPressed(52) == 1) then SpawnCar("pmp600") end

if (IsKeyPressed(53) == 1) then SpawnCar("infernus") end

if (IsKeyPressed(54) == 1) then SpawnCar("comet") end

if (IsKeyPressed(55) == 1) then SpawnCar("supergt") end

if (IsKeyPressed(56) == 1) then SpawnCar("sultanrs") end

if (IsKeyPressed(57) == 1) then SpawnCar("stockade") end

 

I when i trying to spawn car Z + 6 or 7, 8 , 9

I get CTD

Link to comment
Share on other sites

Alexander Blade

biggrin.gif w8

 

Updated !!!

Added Alice Ultimate, see 1st page for more info

alien.gif

Link to comment
Share on other sites

Alex now can you take a look at this script and fix it if you can or made a new one ? Because very often i get CTD wne i want to use it :

--globale variablen

PLAYER_ID, PLAYER_INDEX, PLAYER_CHAR, PLAYER_CAR, SAVEDONE, TIMER = 0

 

function InitScript()

-- Wake up neo ... wake up ....wink.gif

Wait(10000)

end

 

function WaitForPlayerPoolCreation()

while (IsPlayerPoolCreated() == 0) do

Wait(2000)

end

end

 

function WaitForValidPlayer()

PLAYER_CHAR = 0

repeat

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

end

until (PLAYER_CHAR > 0)

end

 

function getPlayerCar()

PLAYER_CAR = 0

IN_CAR = 0

repeat

PushInt(PLAYER_CHAR)

CallNative("IS_CHAR_IN_ANY_CAR")

IN_CAR = GetIntResult()

if(IN_CAR > 0) then

PushInt(PLAYER_CHAR)

PushVarPtr()

CallNative("GET_CAR_CHAR_IS_USING")

PLAYER_CAR = GetIntParam(1)

end

if (PLAYER_CAR <= 0) then

Wait(1000)

end

until (PLAYER_CAR > 0)

end

 

function repairCar(playerCar)

PushInt(playerCar)

CallNative("FIX_CAR")

Wait(300)

end

 

function main()

InitScript()

while true do

WaitForPlayerPoolCreation()

WaitForValidPlayer()

-- F1 -----------------------------

if (IsKeyPressed(112) == 1) then

getPlayerCar()

if PLAYER_CAR > 0 then

repairCar(PLAYER_CAR)

end

end

Wait(500)

end

end

main();

Link to comment
Share on other sites

What is a native to instantly give or take money away from your character?

Or small script

Link to comment
Share on other sites

Gta Guy 108

I have been having this same problem for quite a while, and I know now that Alice has something to do with this problem, but everytime I start a new game of GTA IV, it ALWAYS crashes when I get to Roman's apartment. It says, GTA IV has stopped working and then it asks me to close the program. Does anyone know how to fix this problem?

Link to comment
Share on other sites

New patch available , waiting fot update alex xD

is there a new patch? mercie_blink.gif

Link to comment
Share on other sites

How could i make a piece of audio i pick play?

And how can i get an audio ID

Link to comment
Share on other sites

Is it hard to learn LUA scripting? I would like to learn it:)

I think Lua is the one of the easiest languages to use, I find it quite easy, and i don't have much experience with programming

Link to comment
Share on other sites

and how can I learn it? it uses some kind of tool or you just know what line should be in which place? could anyone help me?

Link to comment
Share on other sites

and how can I learn it? it uses some kind of tool or you just know what line should be in which place? could anyone help me?

You just need notepad

Link to comment
Share on other sites

and how can I learn it? it uses some kind of tool or you just know what line should be in which place? could anyone help me?

You just need notepad

Ok I have that:D what's next?

Link to comment
Share on other sites

Lua.org is a good place to start if you want to learn the Lua language.

 

Here is a link to the current Lua Reference Manual.

 

The best way to learn Lua is to find Lua examples and examine them, particularly Lua scripts for GTA4 if you just want to learn the Lua used by Alice for GTA4.

 

Find some Alice scripts for GTA4, read and understand them then modify them using what you have learned.

Link to comment
Share on other sites

Lua.org is a good place to start if you want to learn the Lua language.

 

Here is a link to the current Lua Reference Manual.

 

The best way to learn Lua is to find Lua examples and examine them, particularly Lua scripts for GTA4 if you just want to learn the Lua used by Alice for GTA4.

 

Find some Alice scripts for GTA4, read and understand them then modify them using what you have learned.

Thanks:) I'll see how it goes

Link to comment
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
 Share

  • 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.