1. Simple question: Is there a way to get the radiation sources in rad towns and alter/disable them individually via plugin?

    I have a private plugin on my server that's Legacy Inspired and I'd like to recreate the radiation dynamics we had back in Legacy, like having different rad towns that have different levels of radiation and perhaps even have different radiations sources inside a same rad town, etc.

    I see two approaches but I fear both won't work:

    1. Disable radiation on server and use Zone Manager to re-instate it. I have a feeling it Zone Manager won't create radiation if radiation is off...?

    2. Find the existing radiation sources and disable them and create new zones with Zone Manager. I have a feeling finding and disabling existing radiation sources might not work.

    My last ditch idea would be to turn it off and simulate it, but then I wouldn't get the visual effect and sound...

    Any ideas and help on this would be nice.
     
  2. emu

    emu

    You can look up all TriggerRadiation components on the scene and turn them off/on or edit their radiation.
    You need to include UnityEngine for this.
    Code:
        TriggerRadiation[] radTriggers = FindObjectsOfType(typeof(TriggerRadiation)) as TriggerRadiation[];
        foreach (TriggerRadiation radTrigger in radTriggers)
        {
            radTrigger.enabled = false; //to disable
            radTrigger.enabled = true; //to enable
            radTrigger.RadiationAmount = 100f; //to change radiation
            Vector3 position = radTrigger.transform.position; //to read its center position
        }
    I didn"t test this but it should work.
     
    Last edited by a moderator: Aug 27, 2015
  3. Radiation does not work! on the server it is on but there is no radiation
     
  4. server.radiation true