Difference between revisions of "Floor player detect"

From Unofficial QEdit Wiki Guide
Jump to: navigation, search
m (Example)
 
Line 1: Line 1:
 +
This opcode is misnamed. The opcode is actually detecting which players exist in the game currently. To figure out which floor number a player is on, see get_floor_number.
 +
 
==Syntax==
 
==Syntax==
 
''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:red'>floor_player_detect </span>register1</span>
 
''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:red'>floor_player_detect </span>register1</span>
Line 6: Line 8:
 
4 registers
 
4 registers
  
1st register = Value of if red gem player on floor.  
+
1st register = Red gem.
  
2nd register = Value of if green gem player on floor.
+
2nd register = Green gem.
  
3rd register = Value of if yellow gem player on floor.  
+
3rd register = Yellow gem.
  
4th register = Value of if blue gem player on floor?.
+
4th register = Blue gem.
  
 
Values.
 
Values.
  
00000000 = Player is not on floor.
+
00000000 = Player does not exist in the game.
  
00000001 = Player is on floor.
+
00000001 = Player does exist in the game.
  
 
==Use==
 
==Use==
Used to set a register based on the players slot number if a player is on the floor where this op code is encountered.
+
Used to set a register based on the players slot number if a player exists in the game.
  
 
==Example==
 
==Example==
Line 28: Line 30:
 
  <span style='color:green'>        ret </span>
 
  <span style='color:green'>        ret </span>
 
  <span style='color:blue'>101:    </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span>
 
  <span style='color:blue'>101:    </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span>
  <span style='color:red'>        floor_player_detect </span>R1 <span style='color:orange'>//Finds out of players are on the floor or not and stores a check for each
+
  <span style='color:red'>        floor_player_detect </span>R1  
                                  player slot in register 1 (slot 1), register 2 (slot 2), register 3
+
                                  (slot 3), register 4 (slot 4) if the player is on the floor the value of
+
                                  their slots register will equal 00000001. if the player is not on the
+
                                  floor the value oftheir slots register will equal 00000000.</span>
+
 
  <span style='color:green'>        jmp </span>101 <span style='color:orange'>//Jumps to function 101.</span>
 
  <span style='color:green'>        jmp </span>101 <span style='color:orange'>//Jumps to function 101.</span>
 
  </span>
 
  </span>

Latest revision as of 21:37, 27 December 2022

This opcode is misnamed. The opcode is actually detecting which players exist in the game currently. To figure out which floor number a player is on, see get_floor_number.

Syntax

Syntax: floor_player_detect register1

  • register1 = Start of continuous registers.

4 registers

1st register = Red gem.

2nd register = Green gem.

3rd register = Yellow gem.

4th register = Blue gem.

Values.

00000000 = Player does not exist in the game.

00000001 = Player does exist in the game.

Use

Used to set a register based on the players slot number if a player exists in the game.

Example


100:     thread_stg 101 //Threads function 101 for as long as you are on the current floor.
         ret 
101:     sync  //Waits 1 frame.
         floor_player_detect R1 
         jmp 101 //Jumps to function 101.

Also see

thread_stg, ret, sync, jmp,

Barebones function 50, Barebones function 70