Difference between revisions of "03F1"

From GTAMods Wiki
Jump to navigation Jump to search
(created article)
 
 
(7 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 pedtype's hostility to other pedtypes
+
| command    = SET_THREAT_FOR_PED_TYPE
| p1          = [[Pedtype]]
+
| description = Sets the [[ped type]]'s hostility to other ped types
| p2          = Flag (threat pedtype)
+
| 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 pedtype's hostility to other pedtypes and will attack the threat pedtype on sight. The threat pedtype cannot overwrite [[hardcoded]] threats or set threats in the [[ped.dat]] file. The threat pedtype is binary converted to decimal format. The effect of this opcode can be reset using [[03F2]].
 
  
==List of threat pedtypes==
+
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 ==
! Flag
+
{|class="wikitable center-col-1"
! GTA III
+
!rowspan="2" |Flag ||rowspan="2" |Binary ||colspan="2" |[[SCM language III/VC definitions#THREAT|Enum]]
! 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
 +
|-
 +
|4
 +
|<code>00 0000 0000 0000 0000 0000 0100</code>
 +
|colspan="2" {{a|c}} |THREAT_PLAYER3
 +
|-
 +
|8
 +
|<code>00 0000 0000 0000 0000 0000 1000</code>
 +
|colspan="2" {{a|c}} |THREAT_PLAYER4
 +
|-
 +
|16
 +
|<code>00 0000 0000 0000 0000 0001 0000</code>
 +
|colspan="2" {{a|c}} |THREAT_CIVMALE
 +
|-
 +
|32
 +
|<code>00 0000 0000 0000 0000 0010 0000</code>
 +
|colspan="2" {{a|c}} |THREAT_CIVFEMALE
 +
|-
 +
|64
 +
|<code>00 0000 0000 0000 0000 0100 0000</code>
 +
|colspan="2" {{a|c}} |THREAT_COP
 +
|-
 +
|128
 +
|<code>00 0000 0000 0000 0000 1000 0000</code>
 +
|THREAT_GANG_MAFIA ||THREAT_GANG_CUBAN
 
|-
 
|-
| 1
+
|256
| PLAYER1
+
|<code>00 0000 0000 0000 0001 0000 0000</code>
| PLAYER1 (you)
+
|THREAT_GANG_TRIAD ||THREAT_GANG_HAITIAN
 
|-
 
|-
| 16
+
|512
|  
+
|<code>00 0000 0000 0000 0010 0000 0000</code>
| CIVMALE
+
|THREAT_GANG_DIABLO ||THREAT_GANG_STREET
 
|-
 
|-
| 32
+
|1024
|  
+
|<code>00 0000 0000 0000 0100 0000 0000</code>
| CIVFEMALE
+
|THREAT_GANG_YAKUZA ||THREAT_GANG_DIAZ
 
|-
 
|-
| 128
+
|2048
|  
+
|<code>00 0000 0000 0000 1000 0000 0000</code>
| GANG1 (Cubans)
+
|THREAT_GANG_YARDIE ||THREAT_GANG_SECURITY
 
|-
 
|-
| 256
+
|4096
|  
+
|<code>00 0000 0000 0001 0000 0000 0000</code>
| GANG2 (Haitians)
+
|THREAT_GANG_COLOMBIAN ||THREAT_GANG_BIKER
 
|-
 
|-
| 512
+
|8192
|  
+
|<code>00 0000 0000 0010 0000 0000 0000</code>
| GANG3 (Streetwannabe's)
+
|THREAT_GANG_HOOD ||THREAT_GANG_PLAYER
 
|-
 
|-
| 1024
+
|16384
|  
+
|<code>00 0000 0000 0100 0000 0000 0000</code>
| GANG4 (Diaz's gang)
+
|||THREAT_GANG_GOLFER
 
|-
 
|-
| 2048
+
|32768
|  
+
|<code>00 0000 0000 1000 0000 0000 0000</code>
| GANG5 (Security guards)
+
|||THREAT_GANG9
 
|-
 
|-
| 4096
+
|65536
|  
+
|<code>00 0000 0001 0000 0000 0000 0000</code>
| GANG6 (Biker gang)
+
|colspan="2" {{a|c}} |THREAT_EMERGENCY
 
|-
 
|-
| 8192
+
|131072
|  
+
|<code>00 0000 0010 0000 0000 0000 0000</code>
| GANG7 (Vercetti gang)
+
|colspan="2" {{a|c}} |THREAT_PROSTITUTE
 
|-
 
|-
| 16384
+
|262144
|  
+
|<code>00 0000 0100 0000 0000 0000 0000</code>
| GANG8 (Golfers)
+
|colspan="2" {{a|c}} |THREAT_CRIMINAL
 
|-
 
|-
| 65536
+
|524288
|  
+
|<code>00 0000 1000 0000 0000 0000 0000</code>
| EMERGENCY (Paramedics)
+
|colspan="2" {{a|c}} |THREAT_SPECIAL
 
|-
 
|-
| 131072
+
|1048576
|  
+
|<code>00 0001 0000 0000 0000 0000 0000</code>
| FIREMAN
+
|colspan="2" {{a|c}} |THREAT_GUN
 
|-
 
|-
| 262144
+
|2097152
|  
+
|<code>00 0010 0000 0000 0000 0000 0000</code>
| CRIMINAL
+
|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
 
|}
 
|}
 +
 +
== 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.
 +
<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