RPGAIO Forums
Awesome "Choose Next" Switch/Case nodes - Printable Version

+- RPGAIO Forums (http://rpgaio.logicspawn.co.uk/forums)
+-- Forum: Discussion and Showcase (http://rpgaio.logicspawn.co.uk/forums/forumdisplay.php?fid=4)
+--- Forum: Tips and Tricks (http://rpgaio.logicspawn.co.uk/forums/forumdisplay.php?fid=11)
+--- Thread: Awesome "Choose Next" Switch/Case nodes (/showthread.php?tid=730)



Awesome "Choose Next" Switch/Case nodes - maniak - 10-16-2018

I have created a set of multi-path nodes that work sort of like a Switch/Case statement
The nodes are called 'Choose Next By Value'

I created 4 variations that handle from 2 to 5 different Case values.
The nodes take an Integer input and then follow a next node path depending on the comparison with Case values.

Here is an example of an NPC dialog that makes random statements by using a Choose Next By Value 3 Case node which allows 3 Case values and an Else (so 4 output paths) - this example is also using my Add Random Integer node 
[attachment=177]

Without these new Random and Choose nodes you would have to chain several Random true/false nodes together to get the same results.


Important: You need to change the file extensions to ".cs" (I had to upload them with the extension ".txt" because ".cs" files are not accepted)

Caution
Backup your GameData just in case something goes wrong and corrupts your configuration. 
If something does go wrong, delete the new node files from your project and restore your GameData backup.

How To Install
You can install these nodes by placing the class files in your project.
In my case I created a new folder called 'Custom' in this location: Assets/RPGAIO/Scripts/RPGMaker/Nodes/Custom
You can put them somewhere else if you like ... but I didn't test it.

*Don't forget to change the extension*


RE: Awesome "Choose Next" Switch/Case nodes - florent1789 - 10-19-2018

thank you for this useful node.


RE: Awesome "Choose Next" Switch/Case nodes - Ken - 10-19-2018

(10-16-2018, 09:36 AM)maniak Wrote: I have created a set of multi-path nodes that work sort of like a Switch/Case statement
The nodes are called 'Choose Next By Value'

I created 4 variations that handle from 2 to 5 different Case values.
The nodes take an Integer input and then follow a next node path depending on the comparison with Case values.

Here is an example of an NPC dialog that makes random statements by using a Choose Next By Value 3 Case node which allows 3 Case values and an Else (so 4 output paths) - this example is also using my Add Random Integer node 


Without these new Random and Choose nodes you would have to chain several Random true/false nodes together to get the same results.


Important: You need to change the file extensions to ".cs" (I had to upload them with the extension ".txt" because ".cs" files are not accepted)

Caution
Backup your GameData just in case something goes wrong and corrupts your configuration. 
If something does go wrong, delete the new node files from your project and restore your GameData backup.

How To Install
You can install these nodes by placing the class files in your project.
In my case I created a new folder called 'Custom' in this location: Assets/RPGAIO/Scripts/RPGMaker/Nodes/Custom
You can put them somewhere else if you like ... but I didn't test it.

*Don't forget to change the extension*

I also say thank you Smile


RE: Awesome "Choose Next" Switch/Case nodes - Wrofir - 10-22-2018

Oh, this is a HUGE time saver. thank you.