Migration Guide: Difference between revisions
From Iron Realms Nexus Client Documentation
(Created page with "The following is intended to aid in the transition from Nexus 2 to Nexus 3. You may notice that many of the settings and layouts of Nexus 3 are close enough to Nexus 2 that it seems familiar, but different. Most of the settings will have copied over from Nexus 2, and modifying them works much the same way it did before. The biggest differences occur in reflexes, or scripting. The following chart lists the most common changes that will break existing scripts or cause err...") |
No edit summary |
||
Line 3: | Line 3: | ||
You may notice that many of the settings and layouts of Nexus 3 are close enough to Nexus 2 that it seems familiar, but different. Most of the settings will have copied over from Nexus 2, and modifying them works much the same way it did before. The biggest differences occur in reflexes, or scripting. The following chart lists the most common changes that will break existing scripts or cause errors. In most cases searching for the Nexus 2 command and replacing it with the Nexus 3 command will solve the problem. | You may notice that many of the settings and layouts of Nexus 3 are close enough to Nexus 2 that it seems familiar, but different. Most of the settings will have copied over from Nexus 2, and modifying them works much the same way it did before. The biggest differences occur in reflexes, or scripting. The following chart lists the most common changes that will break existing scripts or cause errors. In most cases searching for the Nexus 2 command and replacing it with the Nexus 3 command will solve the problem. | ||
Scripting Notes: | =Scripting Notes:= | ||
Most of the most common functions that were used in Nexus 2 have been renamed or moved into a new namespace in Nexus 3. However, aliases have been set up in the client so that you can continue using the functions as you did before. The drawback to this is that the aliases only work in the client. If you're working in the dev console or if you're setting up an external JavaScript file, you'll need to reference these functions in their new namespace and names. The conversions are listed in the chart below. | |||
{| class="wikitable" style="margin:auto" | {| class="wikitable" style="margin:auto" | ||
! | ! Original (In client) !! New (dev console or external JS file) | ||
|- | |- | ||
| GMCP || nexusclient.datahandler().GMCP | | GMCP || nexusclient.datahandler().GMCP | ||
Line 18: | Line 20: | ||
|- | |- | ||
| print() || nexusclient.add_html_line() | | print() || nexusclient.add_html_line() | ||
|- | |- | ||
| client || nexusclient | | client || nexusclient | ||
Line 25: | Line 25: | ||
| gag_current_line() || nexusclient.current_line.gag = true | | gag_current_line() || nexusclient.current_line.gag = true | ||
|} | |} | ||
===Special Scripting Note=== | |||
jQuery is built in to Nexus 2, so it can be used throughout any reflexes. jQuery is not built into Nexus 3 though, so jQuery will not work in Nexus 3 reflexes at all. There are no aliases for it, it is simply not there. |
Latest revision as of 15:26, 3 August 2022
The following is intended to aid in the transition from Nexus 2 to Nexus 3.
You may notice that many of the settings and layouts of Nexus 3 are close enough to Nexus 2 that it seems familiar, but different. Most of the settings will have copied over from Nexus 2, and modifying them works much the same way it did before. The biggest differences occur in reflexes, or scripting. The following chart lists the most common changes that will break existing scripts or cause errors. In most cases searching for the Nexus 2 command and replacing it with the Nexus 3 command will solve the problem.
Scripting Notes:
Most of the most common functions that were used in Nexus 2 have been renamed or moved into a new namespace in Nexus 3. However, aliases have been set up in the client so that you can continue using the functions as you did before. The drawback to this is that the aliases only work in the client. If you're working in the dev console or if you're setting up an external JavaScript file, you'll need to reference these functions in their new namespace and names. The conversions are listed in the chart below.
Original (In client) | New (dev console or external JS file) |
---|---|
GMCP | nexusclient.datahandler().GMCP |
get_variable() | nexusclient.variables().get() |
set_variable() | nexusclient.variables().set() |
run_function() | nexusclient.reflexes().run_function() |
display_notice() | nexusclient.display_notice() |
print() | nexusclient.add_html_line() |
client | nexusclient |
gag_current_line() | nexusclient.current_line.gag = true |
Special Scripting Note
jQuery is built in to Nexus 2, so it can be used throughout any reflexes. jQuery is not built into Nexus 3 though, so jQuery will not work in Nexus 3 reflexes at all. There are no aliases for it, it is simply not there.