03F1

From GTAModding
Jump to: navigation, search

GTA III Vice City SET_THREAT_FOR_PED_TYPE


Description
Sets the ped type's hostility to other ped types
Syntax
03F1: pedtype [int1] add_threat [int2]
Parameter
[int1]
Ped type
[int2]
Ped threat in flag field representation (see below)

This opcode sets the ped type's hostility to other ped types and will attack the threat ped type on sight. The threat ped type cannot overwrite hardcoded threats but it can overwrite most threats set in the ped.dat file. The threat ped type value is represented as a flag field. The effect of this opcode can be reset using 03F2. Peds that are already spawned cannot have their hostility changed actively using this opcode; this opcode only works on newly spawned peds.

Ped threats

Flag Binary Enum
GTA III Vice City
1 00 0000 0000 0000 0000 0000 0001 THREAT_PLAYER1
2 00 0000 0000 0000 0000 0000 0010 THREAT_PLAYER2
4 00 0000 0000 0000 0000 0000 0100 THREAT_PLAYER3
8 00 0000 0000 0000 0000 0000 1000 THREAT_PLAYER4
16 00 0000 0000 0000 0000 0001 0000 THREAT_CIVMALE
32 00 0000 0000 0000 0000 0010 0000 THREAT_CIVFEMALE
64 00 0000 0000 0000 0000 0100 0000 THREAT_COP
128 00 0000 0000 0000 0000 1000 0000 THREAT_GANG_MAFIA THREAT_GANG_CUBAN
256 00 0000 0000 0000 0001 0000 0000 THREAT_GANG_TRIAD THREAT_GANG_HAITIAN
512 00 0000 0000 0000 0010 0000 0000 THREAT_GANG_DIABLO THREAT_GANG_STREET
1024 00 0000 0000 0000 0100 0000 0000 THREAT_GANG_YAKUZA THREAT_GANG_DIAZ
2048 00 0000 0000 0000 1000 0000 0000 THREAT_GANG_YARDIE THREAT_GANG_SECURITY
4096 00 0000 0000 0001 0000 0000 0000 THREAT_GANG_COLOMBIAN THREAT_GANG_BIKER
8192 00 0000 0000 0010 0000 0000 0000 THREAT_GANG_HOOD THREAT_GANG_PLAYER
16384 00 0000 0000 0100 0000 0000 0000 THREAT_GANG_GOLFER
32768 00 0000 0000 1000 0000 0000 0000 THREAT_GANG9
65536 00 0000 0001 0000 0000 0000 0000 THREAT_EMERGENCY
131072 00 0000 0010 0000 0000 0000 0000 THREAT_PROSTITUTE
262144 00 0000 0100 0000 0000 0000 0000 THREAT_CRIMINAL
524288 00 0000 1000 0000 0000 0000 0000 THREAT_SPECIAL
1048576 00 0001 0000 0000 0000 0000 0000 THREAT_GUN
2097152 00 0010 0000 0000 0000 0000 0000 THREAT_COP_CAR
4194304 00 0100 0000 0000 0000 0000 0000 THREAT_FAST_CAR
8388608 00 1000 0000 0000 0000 0000 0000 THREAT_EXPLOSION
16777216 01 0000 0000 0000 0000 0000 0000 THREAT_FIREMAN
33554432 10 0000 0000 0000 0000 0000 0000 THREAT_DEADPEDS

Example

The following example lets you toggle Triads/Haitians hate towards the player by pressing the CAMERA key. A number is displayed on the screen to show the gang's hostility; 0 means it is not hostile and 1 means it is. This opcode only affects newly spawned gang members; gang members already spawned will not be affected.

// set constant
const
HATE = 0@
end

// reset gang hate to player
03F2: pedgroup 8 remove_threat 1
HATE = false

// toggle gang hate to player
while true
    wait 250
    if 
        00E1:   key_pressed 0 13  // camera key
    then
        if
            HATE == false
        then
            03F1: pedtype 8 add_threat 1  // set gang hostile
            HATE = true
        else
            03F2: pedgroup 8 remove_threat 1  // set gang not hostile
            HATE = false
        end
    end
    // display gang hate as a number onscreen
    01E5: text_1number_highpriority 'NUMBER' HATE 250 ms 1
end

Keywords

set, add, threat, aggressive, hate, hostile, pedtype, gang