Difference between revisions of "03F1"

From GTAMods Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
__NOTOC__
 
{{OpCode
 
{{OpCode
| ini        = 03F1=2,%1e% %2e%
+
| games      = {{Icon|3}} {{Icon|VC}}
| description = Sets the ped type's hostility to other pedtypes
+
| command    = SET_THREAT_FOR_PED_TYPE
| p1          = [[Ped type]]
+
| description = Sets the [[ped type]]'s hostility to other ped types
| p2          = Flag (threat ped type)
+
| syntax1    = 03F1: pedtype [''int1''] add_threat [''int2'']
| game        = [[GTA 3]], [[Vice City]]
+
| p1t        = [''int1'']
 +
| p1d        = [[Ped type]]
 +
| p2t        = [''int2'']
 +
| p2d        = 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 or threats set in the [[ped.dat]] file. The threat ped type is binary converted to decimal format. The effect of this opcode can be reset using [[03F2]].
 
  
==List of usable values==
+
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.
The following is a list of usable flags to use as threat pedtype.
+
 
{| {{Prettytable}}
+
== Ped threats ==
! Parameter 1
+
{|class="wikitable center-col-1"
! Parameter 2
+
!rowspan="2" |Flag ||rowspan="2" |Binary ||colspan="2" |[[SCM language III/VC definitions#THREAT|Enum]]
! GTA III
+
|-
! Vice City
+
!{{Icon|3}} ||{{Icon|VC}}
 +
|-
 +
|1
 +
|<code>00 0000 0000 0000 0000 0000 0001</code>
 +
|colspan="2" {{a|c}} |THREAT_PLAYER1
 +
|-
 +
|2
 +
|<code>00 0000 0000 0000 0000 0000 0010</code>
 +
|colspan="2" {{a|c}} |THREAT_PLAYER2
 
|-
 
|-
| 0
+
|4
| 1
+
|<code>00 0000 0000 0000 0000 0000 0100</code>
| align="center" colspan="2"| PLAYER1 (you)
+
|colspan="2" {{a|c}} |THREAT_PLAYER3
 
|-
 
|-
| 1
+
|8
| 2
+
|<code>00 0000 0000 0000 0000 0000 1000</code>
| align="center" colspan="2"| PLAYER2 (unused)
+
|colspan="2" {{a|c}} |THREAT_PLAYER4
 
|-
 
|-
| 2
+
|16
| 4
+
|<code>00 0000 0000 0000 0000 0001 0000</code>
| align="center" colspan="2"| PLAYER3 (unused)
+
|colspan="2" {{a|c}} |THREAT_CIVMALE
 
|-
 
|-
| 3
+
|32
| 8
+
|<code>00 0000 0000 0000 0000 0010 0000</code>
| align="center" colspan="2"| PLAYER4 (unused)
+
|colspan="2" {{a|c}} |THREAT_CIVFEMALE
 
|-
 
|-
| 4
+
|64
| 16
+
|<code>00 0000 0000 0000 0000 0100 0000</code>
| align="center" colspan="2"| CIVMALE
+
|colspan="2" {{a|c}} |THREAT_COP
 
|-
 
|-
| 5
+
|128
| 32
+
|<code>00 0000 0000 0000 0000 1000 0000</code>
| align="center" colspan="2"| CIVFEMALE
+
|THREAT_GANG_MAFIA ||THREAT_GANG_CUBAN
 
|-
 
|-
| 6
+
|256
| 64
+
|<code>00 0000 0000 0000 0001 0000 0000</code>
| align="center" colspan="2"| COP
+
|THREAT_GANG_TRIAD ||THREAT_GANG_HAITIAN
 
|-
 
|-
| 7
+
|512
| 128
+
|<code>00 0000 0000 0000 0010 0000 0000</code>
| GANG1 (Mafia)
+
|THREAT_GANG_DIABLO ||THREAT_GANG_STREET
| GANG1 (Cubans)
 
 
|-
 
|-
| 8
+
|1024
| 256
+
|<code>00 0000 0000 0000 0100 0000 0000</code>
| GANG2 (Triads)
+
|THREAT_GANG_YAKUZA ||THREAT_GANG_DIAZ
| GANG2 (Haitians)
 
 
|-
 
|-
| 9
+
|2048
| 512
+
|<code>00 0000 0000 0000 1000 0000 0000</code>
| GANG3 (Diablos)
+
|THREAT_GANG_YARDIE ||THREAT_GANG_SECURITY
| GANG3 (Streetwannabe's)
 
 
|-
 
|-
| 10
+
|4096
| 1024
+
|<code>00 0000 0000 0001 0000 0000 0000</code>
| GANG4 (Yakuza)
+
|THREAT_GANG_COLOMBIAN ||THREAT_GANG_BIKER
| GANG4 (Diaz's gang)
 
 
|-
 
|-
| 11
+
|8192
| 2048
+
|<code>00 0000 0000 0010 0000 0000 0000</code>
| GANG5 (Yardies)
+
|THREAT_GANG_HOOD ||THREAT_GANG_PLAYER
| GANG5 (Security guards)
 
 
|-
 
|-
| 12
+
|16384
| 4096
+
|<code>00 0000 0000 0100 0000 0000 0000</code>
| GANG6 (Colombians)
+
|||THREAT_GANG_GOLFER
| GANG6 (Biker gang)
 
 
|-
 
|-
| 13
+
|32768
| 8192
+
|<code>00 0000 0000 1000 0000 0000 0000</code>
| GANG7 Hoods
+
|||THREAT_GANG9
| GANG7 (Vercetti gang)
 
 
|-
 
|-
| 14
+
|65536
| 16384
+
|<code>00 0000 0001 0000 0000 0000 0000</code>
| GANG8 (unused)
+
|colspan="2" {{a|c}} |THREAT_EMERGENCY
| GANG8 (Golfers)
 
 
|-
 
|-
| 15
+
|131072
| 32768
+
|<code>00 0000 0010 0000 0000 0000 0000</code>
| align="center" colspan="2"| GANG9 (unused)
+
|colspan="2" {{a|c}} |THREAT_PROSTITUTE
 
|-
 
|-
| 16
+
|262144
| 65536
+
|<code>00 0000 0100 0000 0000 0000 0000</code>
| align="center" colspan="2"| EMERGENCY (Paramedics)
+
|colspan="2" {{a|c}} |THREAT_CRIMINAL
 
|-
 
|-
| 17
+
|524288
| 131072
+
|<code>00 0000 1000 0000 0000 0000 0000</code>
| align="center" colspan="2"| FIREMAN
+
|colspan="2" {{a|c}} |THREAT_SPECIAL
 
|-
 
|-
| 18
+
|1048576
| 262144
+
|<code>00 0001 0000 0000 0000 0000 0000</code>
| align="center" colspan="2"| CRIMINAL
+
|colspan="2" {{a|c}} |THREAT_GUN
 
|-
 
|-
| 19
+
|2097152
| 524288
+
|<code>00 0010 0000 0000 0000 0000 0000</code>
| align="center" colspan="2"| SPECIAL
+
|colspan="2" {{a|c}} |THREAT_COP_CAR
 +
|-
 +
|4194304
 +
|<code>00 0100 0000 0000 0000 0000 0000</code>
 +
|colspan="2" {{a|c}} |THREAT_FAST_CAR
 +
|-
 +
|8388608
 +
|<code>00 1000 0000 0000 0000 0000 0000</code>
 +
|colspan="2" {{a|c}} |THREAT_EXPLOSION
 +
|-
 +
|16777216
 +
|<code>01 0000 0000 0000 0000 0000 0000</code>
 +
|colspan="2" {{a|c}} |THREAT_FIREMAN
 +
|-
 +
|33554432
 +
|<code>10 0000 0000 0000 0000 0000 0000</code>
 +
|colspan="2" {{a|c}} |THREAT_DEADPEDS
 
|}
 
|}
  
==Keywords==
+
== Example ==
aggressive, hate, hostile, pedtype, gang
+
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.
 +
<source lang="scm">
 +
// 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
 +
</source>
 +
 
 +
== Keywords ==
 +
set, add, threat, aggressive, hate, hostile, pedtype, gang

Latest revision as of 05:08, 5 January 2016

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