Difference between revisions of "Get coord player detect"

From Unofficial QEdit Wiki Guide
Jump to: navigation, search
(Created page with "==Syntax== ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:green'>particle_v3</span> register1, register5</span> * ''register1 = X value.'' *...")
 
(Example)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Syntax==
 
==Syntax==
''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:green'>particle_v3</span> register1, register5</span>
+
''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:green'>get_coord_player_detect</span> register1, register4</span>
  
 
* ''register1 = X value.''
 
* ''register1 = X value.''
 
* ''register2 = Z value.''
 
* ''register2 = Z value.''
 
* ''register3 = Radius.''
 
* ''register3 = Radius.''
* ''register4 = Player slot.''
+
* ''register4 = Output for slot 0.''
* ''register5 = Output.''
+
* ''register5 = Output for slot 1.''
 +
* ''register6 = Output for slot 2.''
 +
* ''register7 = Output for slot 3.''
  
 
==Use==
 
==Use==
Line 12: Line 14:
  
 
==Example==
 
==Example==
<span style='color:orange'>//Detecting the player within the given parameters.</span>
+
<span style='color:blue'>100: </span><span style='color:green'>leti </span>R1, 0000000A <span style='color:orange'>             //Set the X value to 10.</span>
<span style='color:blue'>0:  </span><span style='color:green'>get_slotnumber </span>R250 <span style='color:orange'>//Gets the player's slot # and puts it in R250.</span>
+
<span style='color:green'>     leti </span>R2, 00000014 <span style='color:orange'>             //Set Z value to 20.</span>
<span style='color:blue'>100:    </span><span style='color:green'>leti </span>R1, 0000000A <span style='color:orange'>//Set the X value to 10.</span>
+
<span style='color:green'>     leti </span>R3, 00000064 <span style='color:orange'>             //Set the radius to 100.</span>
  <span style='color:green'>         leti </span>R2, 00000000 <span style='color:orange'>//Set Z value to 0</span>
+
  <span style='color:green'>     get_coord_player_detect</span> R1, R4 <span style='color:orange'>//Tells where to start the continuation of registry strings to be used for the coordinates.</span>
  <span style='color:green'>         leti </span>R3, 00000064 <span style='color:orange'>//Set the radius to 100</span>
+
  <span style='color:blue'></span><span style='color:green'>     jmpi_= </span>R4, 00000000, 101
  <span style='color:green'>         let </span> R4, R250 <span style='color:orange'>//Set the player slot to R250</span>
+
<span style='color:blue'>     </span><span style='color:green'>window_msg</span> 'Slot 0 is in the radius!'
  <span style='color:green'>         leti </span>R5, 00000000 <span style='color:orange'>//Output if the player is standing within the radius set in R3</span>
+
<span style='color:green'>    winend </span>
  <span style='color:green'>         particle_v3 R1 </span><span style='color:orange'>//Tells where to start the continuation of registry strings to be used for the coordinates</span>
+
  <span style='color:blue'>101:</span><span style='color:green'> jmpi_= </span>R5, 00000000, 102
  <span style='color:green'>         ret </span>
+
<span style='color:blue'>     </span><span style='color:green'>window_msg</span> 'Slot 1 is in the radius!'
 +
<span style='color:green'>    winend </span>
 +
  <span style='color:blue'>102:</span><span style='color:green'> jmpi_= </span>R6, 00000000, 103
 +
<span style='color:blue'>     </span><span style='color:green'>window_msg</span> 'Slot 2 is in the radius!'
 +
<span style='color:green'>    winend </span>
 +
  <span style='color:blue'>103:</span><span style='color:green'> jmpi_= </span>R7, 00000000, 104
 +
<span style='color:blue'>     </span><span style='color:green'>window_msg</span> 'Slot 3 is in the radius!'
 +
<span style='color:green'>    winend </span>
 +
  <span style='color:blue'>104:</span><span style='color:green'> ret </span>
 +
 
 +
==Also see==
 +
[[leti]] [[let]] [[jmpiue]] [[get_slotnumber]] [[ret]]

Latest revision as of 15:34, 16 June 2022

Syntax

Syntax: get_coord_player_detect register1, register4

  • register1 = X value.
  • register2 = Z value.
  • register3 = Radius.
  • register4 = Output for slot 0.
  • register5 = Output for slot 1.
  • register6 = Output for slot 2.
  • register7 = Output for slot 3.

Use

Script version of a touch plate object; used to detect a player's location within specific set parameters.

Example

100: leti R1, 0000000A              //Set the X value to 10.
     leti R2, 00000014              //Set Z value to 20.
     leti R3, 00000064              //Set the radius to 100.
     get_coord_player_detect R1, R4 //Tells where to start the continuation of registry strings to be used for the coordinates.
     jmpi_= R4, 00000000, 101
     window_msg 'Slot 0 is in the radius!'
     winend 
101: jmpi_= R5, 00000000, 102
     window_msg 'Slot 1 is in the radius!'
     winend 
102: jmpi_= R6, 00000000, 103
     window_msg 'Slot 2 is in the radius!'
     winend 
103: jmpi_= R7, 00000000, 104
     window_msg 'Slot 3 is in the radius!'
     winend 
104: ret 

Also see

leti let jmpiue get_slotnumber ret