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 Diamond Casino 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. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

      1. Guides & Strategies
      2. Help & Support
    11. 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. DYOM
      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


Script Issues (works in wrong way)

Recommended Posts

Posted (edited)

I have decided to make an external script for main.scm, but
for testing purposes I have created it as a CLEO first. 
My script is about to get a special pass to enter Las Venturas (this conditions needs for my set of missions), the city is locked by default, so You need to to proceed to guards to get special pass. For cotrol of obtaining a pass I'm using a global variable $PROPUSK.
I have written a code: https://pastebin.com/Sn0L14qk - I have a custom weapon added in my game so don't metion a #G36 weapon model and 80 weapon's ID inside of my code - it's alright.
Moved a script scene to the Grove street for more convienient test (originaly it's for LS-LV bridge scene);
Issues I have encounter in my code I can't figure out how to solve:

1. Since I'm doing a check of acts of agression performed by player or any other ped to the guard, I have placed gosub '@PROPUSKLV_AGRESSION' into main loop '@PROPUSKLV_WORK', returning false from conditions of this gosub should bring it to '@PROPUSKLV_ATTACK' section where it forcing guard actor attacks player, returning true should return to the main loop;
 - It works OK only if player haven't got a pass ($PROPUSK = 1), but after player getting a pass guard do not pays any attention on same obvious acts I'm checking in '@PROPUSKLV_AGRESSION' so the actor acts stupid like: ducking, handsup if shots fired at him or he being aimed by player... I can't understand which condition makes it ignore '@PROPUSKLV_AGRESSION' after it returning true in '@PROPUSKLV_YES', what's wrong with my code? 

2. I need to have agression acts be registered not only coming from player, but also any other ped, which is acting agressive to the guard. I couldn't create a suitable code for separating agression from player or any other actor with respective answer from guard (if PED attacks guard - guard attacking PED back, if player attacks guard - guard attacks player back), so I made it all such bad event leading to guards turns agressive towards player...
But I see that I cannot reach an effect I want - i'm checking a guard's PED EVENTs like bullet whiz, shots fired etc - but it's all works only coming from PLAYER.. other peds seems like not creating such events to the guard actor, so he ignores any agression from PED: stading still taking damage from gangs etc, but i wanted him to react more realistic to such events and fight back;

How to fix my code to have ability to change guard actor behavior? May be someone can give a hand of iproving my code: make corrects check on ped events or add descision makers - which i'm really weak with (I have tried to add, but it was leading to crash or showing no effects... - I have removed it from code).
3. PED EVENT check up if player gathering a group should force actor to attack player if return true: just for a test I have entered 'SJMAHPE' cheat code and get guard actor into player's group - this is what I'm trying to get rid of.. I need this actor to refuse joing a player's group and start attacks him for this attempt. I know when actor getting into player's group he becomes to be harmless to the player, but I'm really have no clue how to make it works like I want. I don't like the fact this actor can join the group. Any soultion for this?

4. Back to the problem of ignoring a PED EVENTs check, I also need this guard actor turns agressive to the player if he attempted to run him over by a car, so called 'VEHICLE_THREAT' - doesn't work for me... 
5. In this case we have a native animations of guard: when he is experiencing a VEHICLE_THREAT or pushed by someone - he is changin his original position - these can even move him very far away from a scene... 
I need to make actor return in his original position if he was moved away by some force. I've tried to make a gosub in main loop - store pos and check if it's same to original, as_actor to go to original position if it false with wait of 1000 ms. But it wasn't working OK - it made the red sphere ('@PROPUSKLV_WORK' getting a pass dialoge with guard trigger) dissapear (still worked though) and then lead to crash of game, after actor action sequence of going to original position worked for the second time...

I'm just studing the coding, my whole code and mistakes may look naive to experienced guys, but anyway - I cannot improve it if i can't get a proper example of "how to do"
May ask a community help for me with this issues to show how it should be?


Edited by Ryabaahd

Share this post

Link to post
Share on other sites

:( i dont wanna read all what is this #G36 i see here in code make it simple what you need ? 

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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