A problem has been noted by several people that there is no not-unreasonably heavy sphere in the game that does not explode. This In-Game Scripting script will disable all bombs in a machine, and as a bonus shows some things you can do that could be useful for future scripts. By no means does it preclude other scripts, and the simStart of it can be copied into the simStart of other another script in order to use their effects simultaneously, assuming that is not too long or Spaar has added a scrollbar to In-Game Scripting by then.
Note that this does not affect any save files; if you get rid of the script and then reload your creation, the affected bombs will explode as normal.
I realize that I am basically using the scripting mod to write other mods at this point, and that that is not the intended use of IGS, but I prefer this to trying to find my way around an IDE. Maybe I'll look into that "Reflexil" thing ITR mentioned...
EDIT: It has been brought to my attention by ITR that this may not work if you have their ModifyExplosion mod installed. The slightly longer, slightly hackier, very slightly laggier script below definitely should, though. Probably.
I really should just learn Modloader...
Code:
import('UnityEngine')
simStart = function ()
blocknum = GameObject.Find('BlockCounter/BlockCounter'):GetComponent('TextMesh').text
i = 0; j = 0; blocknum = tonumber(blocknum)
while true do
k = GameObject.Find('bgeL'..i)
if k then GameObject.Destroy(k:GetComponent('ExplodeOnCollide')); j=j+1 end
k = GameObject.Find('bsg'..i)
if k then GameObject.Destroy(k:GetComponent('ExplodeOnCollide')); j=j+1 end
if (j == blocknum) then break end
i=i+1
end
end
frame = function ()
end
I realize that I am basically using the scripting mod to write other mods at this point, and that that is not the intended use of IGS, but I prefer this to trying to find my way around an IDE. Maybe I'll look into that "Reflexil" thing ITR mentioned...
EDIT: It has been brought to my attention by ITR that this may not work if you have their ModifyExplosion mod installed. The slightly longer, slightly hackier, very slightly laggier script below definitely should, though. Probably.
Code:
import('UnityEngine')
inelegantbuteffective = true
simStart = function ()
inelegantbuteffective = true
end
frame = function ()
if inelegantbuteffective then
blocknum = GameObject.Find('BlockCounter/BlockCounter'):GetComponent('TextMesh').text
i = 0; j = 0; blocknum = tonumber(blocknum)
while true do
k = GameObject.Find('bgeL'..i)
if k then GameObject.Destroy(k:GetComponent('ExplodeOnCollide')); j=j+1 end
k = GameObject.Find('bsg'..i)
if k then GameObject.Destroy(k:GetComponent('ExplodeOnCollide')); j=j+1 end
if (j == blocknum) then break end
i=i+1
end
inelegantbbuteffective = false
end
end