Constant-velocity joint mod [Spaar`s Modloader][v0.42b]

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#21
If you have a global variable: "GameObject bgeL1":
HTML:
if(bgeL1==null){
          bgeL1 = GameObject.Find("bgeL1");
          if(bgeL1!=null){
                    DoAllStuffNeededToMakeSureAllBlocksHaveTheRightComponent();
          }
}
That should make it work with as little lag as possible.
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#23
Well, the "DoAllStuffNeededToMakeSureAllBlocksHaveTheRightComponent();" doesn't matter if is a little laggy, because it will only be called once, when a new machine is loaded. So you can just use the FindObjectOfType() thing there.
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#24
Oh, also, you should join the slack team
 
#26
The slack team is a team chat room (kind of).
You can chat with text real-time with other team members.
You can discuss modding, share codes, and basically have a great time!

If you do want to join it, send a PM with your email to spaar.
 

spaar

Active Member
#27
CroCraCri Instead of doing any interating over any lists of blocks or using any FindObjectOfType-kind method, try just adding your component to the templates in AddPiece.blockTypes and MachineObjectTracker.AllPrefabs. You can use this file to get the respective indices you need. In the future, you'll also be able to access those enums in the mod loader, but not quite yet.
 

Psh

New Member
#32
Your mod is great, thanks a lot! I hope you will be able to apdate it to v0.3 . Also i have a question, is it possible to create a block wich acts like differential (rear axle in car) ?

p.s. sorry for my english)
 
#36
Local. The idea is that the ball joint is fixed along it's length, but still articulates in the other 2 directions so you can use it in drive mechanisms to go around corners. Look up CV (Constant Velocity) joint on wikipedia.
 
#40
i put it in the mods folder and i clicked the block configuration button, then i clicked on the joint just like you said in the tutorial... it doesnt have the "Constant- Velocity joint"!
 
Top