Comments (8)
Most trick powers require a number constant.
from psi.
modulo and then integer division might be what you want, say you want to run it every 5th step
(1 mod 5) / 4 = 0
(4 mod 5) / 4 = 1
(5 mod 5) / 4 = 0
(6 mod 5) / 4 = 0
etc
(fixed because apparently i do not understand 10th grade math)
Also motion to not make tricks require constants
Or maybe have a piece that doesn't pass further down it's path if it doesn't receive a number > 0 or another type != null?
(I don't actually know how spells evaluate in this)
from psi.
tricks need constants because that's how cost is determined
from psi.
yeah but tricks have other inputs apart from the constant. There's probably very hacky ways to make conditionals work.
Also some tricks take a constant max for cost determination and a variable parameter for level of actual performance.
from psi.
It's totally doable. I've found a few "hacky" ways to do conditionals, but the easiest way is one you're already on track for. After using modulo to make the value 1 only when you want it to run, put the result through an inverse function. 1^-1 is 1, but 0^-1 is a divide by zero error. Then just feed that inverse function into the spell somewhere to crash it. The easiest way is just to multiply something by it, like a vector or other number that the spell uses. The error will follow down the line to the trick, and crash the spell.
As an added bonus, you can crash one trick in a spell, while making another trick still work. The spell compiler reads left to right, top to bottom, so as long as the trick you're crashing comes after the trick you want to work, the spell will cast the first part.
If you want to see an example of some of this stuff in action, check out my flight spell on /r/psispellcompendium. [link]
from psi.
Booleans and conditionals are not in the plans, as I don't want to make Psi a fully fledged "visual programming" system, but rather a simple sequence of actions. What I have in mind is a "Trick: Die" of sorts, which will take a Number parameter and stop the spell execution if it's between 0 and 1 (exclusive).
If that sounds finicky, that's because it is. I like throwing wrenches into your plans.
from psi.
this is not flow control, it's just flow stoppage
from psi.
from psi.
Related Issues (20)
- All Achievements unlocked after punching a tree? HOT 3
- Texture Issues in 1.19 HOT 5
- (Multiplayer) Energy bar capacity/regen rate desync HOT 2
- Opening Text Popup constantly repeating HOT 1
- ContributorSpellCircleHandler doesn't catch StringIndexOutOfBoundsException
- Unable to play on M1 macOS HOT 5
- Psi crashing a server because of net.minecraft.resources.ResourceLocation net.minecraft.sounds.SoundEvent.getLocation() HOT 1
- Crash with SophisticatedCore HOT 3
- Psi 1.18.2-98 is failing to start on macOS in native aarch64 mode HOT 1
- Psi 1.19-101 fails to start on macOS in native aarch64 mode HOT 1
- CAD server crash HOT 1
- [Bug] PSI destroys any items in cursor when exiting rod contructor
- Vector ruler broken at Y=-1
- Load Fail on Windows. HOT 2
- Trick Die consuming mana from a trick even if the trick was never activated HOT 1
- Observable causes crash/disconnect with flight spells HOT 7
- Cannot cast manually when looking at an armor stand
- Psimetal tools have incorrect mining level
- Upwards add motion doesn't prevent players from getting kicked for flying
- FEATURE REQUEST: Disassemble CADs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psi.