Jump to content

37 posts in this topic Last Reply

Recommended Posts

2 hours ago, AmiPolizeiFunk said:

Well I noticed that there are variables in the light effects to say which axis to rotate and at what speed. I was able to edit them in ModTools, and the spotlight started animating round and round... looking just like a lighthouse or movie searchlight. If I knew how to make a quick .gif of it, I would have, cause it was really cool looking.

Right, but those values can not be saved, so you would need an additional mod that creates a new light effect.

Share this post


Link to post
Share on other sites
  • Original Poster
  •  

    Released a new asset, which is a collaboration with vasimr22 (who has been making some great airport assets). It's a runway threshold lights prop. Originally we wanted to do some green lights, but 

    Aircraft Light Right
      Type: Spot
      Intensity: 1
      Blink Type: None
      Base Color: A0FFA0

     

    from the list on github didn't work.

     

    In fact, many of the light types didn't work. Is there a special trick to get the vehicle light effects to work on a prop?

     

    PreviewImage.png.242be86b477105e2cf770cbff1fafe43.png

    https://steamcommunity.com/sharedfiles/filedetails/?id=908980935

     

    FINAL WORKING SCRIPT FOR FOUR LIGHT EFFECTS:

     
    
    // --- FIRST LIGHT EFFECT ---
    // Used light effect
    var lightEffect1 = EffectCollection.FindEffect("Flood Light Short Red") as LightEffect;
    // Final position in prop
    Vector3 pos1 = new Vector3(0f,1f,0f); 
    // 
    // Final direction in prop
    Vector3 dir1 = new Vector3(0f,0.2588f,0.9659f);
    // pointing forward about 15deg
    var propEffect1 = new PropInfo.Effect {m_effect = lightEffect1, m_position = pos1, m_direction = dir1 };
    	
    // --- SECOND LIGHT EFFECT ---
    // Used light effect
    var lightEffect2 = EffectCollection.FindEffect("Flood Light Short Red") as LightEffect;
    // Final position in prop
    Vector3 pos2 = new Vector3(-1.7f,1f,0f); 
    // 
    // Final direction in prop
    Vector3 dir2 = new Vector3(0f,0.2588f,0.9659f);
    //  
    var propEffect2 = new PropInfo.Effect {m_effect = lightEffect2, m_position = pos2, m_direction = dir2 };
    	
    // --- THIRD LIGHT EFFECT ---
    var lightEffect3 = EffectCollection.FindEffect("Flood Light Short Red") as LightEffect;
    Vector3 pos3 = new Vector3(-3.4f,1f,0f);
    // ..
    Vector3 dir3 = new Vector3(0f,0.2588f,0.9659f);
    // ..
    var propEffect3 = new PropInfo.Effect {m_effect = lightEffect3, m_position = pos3, m_direction = dir3 };
    	
    // --- FOURTH LIGHT EFFECT ---
    var lightEffect4 = EffectCollection.FindEffect("Flood Light Short Red") as LightEffect;
    Vector3 pos4 = new Vector3(-5.1f,1f,0f);
    // ..
    Vector3 dir4 = new Vector3(0f,0.2588f,0.9659f);
    // ..
    var propEffect4 = new PropInfo.Effect {m_effect = lightEffect4, m_position = pos4, m_direction = dir4 };
    	
    // Apply effects to prop
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_effects = new PropInfo.Effect[] { propEffect1, propEffect2, propEffect3, propEffect4};
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_hasEffects = true;

     

    Share this post


    Link to post
    Share on other sites
    6 hours ago, AmiPolizeiFunk said:

    Any ideas, anyone? green light effects on props?

    You can find all available effects (also sound effects) in the EffectCollection in the ModTools scene explorer.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • I'm liking this script. Here's one with eighteen light effects. :)20170514232642_1.thumb.jpg.0d2f58dfdfce4c2a05b0496e5b541b45.jpg

    Spoiler
    
    // --- FIRST LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect1 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    
    // Final position in prop
    Vector3 pos1 = new Vector3(0f,16f,0f); 
    // 
    
    // Final direction in prop
    Vector3 dir1 = new Vector3(0f,-2.00f,-1f);
    // pointing up 
    
    var propEffect1 = new PropInfo.Effect {m_effect = lightEffect1, m_position = pos1, m_direction = dir1 };
    
    
    // --- SECOND LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect2 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    
    // Final position in prop
    Vector3 pos2 = new Vector3(-1.923f,16f,0f); 
    // 
    
    // Final direction in prop
    Vector3 dir2 = new Vector3(0f,-2.00f,-1f);
    //  
    
    var propEffect2 = new PropInfo.Effect {m_effect = lightEffect2, m_position = pos2, m_direction = dir2 };
    
    
    // --- THIRD LIGHT EFFECT ---
    
    var lightEffect3 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos3 = new Vector3(-3.817f,16f,0f);
    // ..
    Vector3 dir3 = new Vector3(0f,-2.00f,-1f);
    // ..
    
    var propEffect3 = new PropInfo.Effect {m_effect = lightEffect3, m_position = pos3, m_direction = dir3 };
    
    
    // --- FOURTH LIGHT EFFECT ---
    
    var lightEffect4 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos4 = new Vector3(-5.751f,16f,0f);
    // ..
    Vector3 dir4 = new Vector3(0f,-2.00f,-1f);
    // ..
    var propEffect4 = new PropInfo.Effect {m_effect = lightEffect4, m_position = pos4, m_direction = dir4 };
    
    
    // --- 5 LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect5 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    
    // Final position in prop
    Vector3 pos5 = new Vector3(1.923f,16f,0f); 
    // 
    
    // Final direction in prop
    Vector3 dir5 = new Vector3(0f,-2.00f,-1f);
    // pointing up 
    
    var propEffect5 = new PropInfo.Effect {m_effect = lightEffect5, m_position = pos5, m_direction = dir5 };
    
    
    // --- 6 LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect6 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    
    // Final position in prop
    Vector3 pos6 = new Vector3(3.817f,16f,0f); 
    // 
    
    // Final direction in prop
    Vector3 dir6 = new Vector3(0f,-2.00f,-1f);
    //  
    
    var propEffect6 = new PropInfo.Effect {m_effect = lightEffect6, m_position = pos6, m_direction = dir6 };
    
    
    // --- 7 LIGHT EFFECT ---
    
    var lightEffect7 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos7 = new Vector3(5.751f,16f,0f);
    // ..
    Vector3 dir7 = new Vector3(0f,-2.00f,-1f);
    // ..
    
    var propEffect7 = new PropInfo.Effect {m_effect = lightEffect7, m_position = pos7, m_direction = dir7 };
    
    
    // --- 8 LIGHT EFFECT ---
    
    var lightEffect8 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos8 = new Vector3(7.666f,16f,0f);
    // ..
    Vector3 dir8 = new Vector3(0f,-2.00f,-1f);
    // ..
    var propEffect8 = new PropInfo.Effect {m_effect = lightEffect8, m_position = pos8, m_direction = dir8 };
    
    
    // --- 9 LIGHT EFFECT ---
    
    var lightEffect9 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos9 = new Vector3(-7.666f,16f,0f);
    // ..
    Vector3 dir9 = new Vector3(0f,-2.00f,-1f);
    // ..
    var propEffect9 = new PropInfo.Effect {m_effect = lightEffect9, m_position = pos9, m_direction = dir9 };
    
    
    // --- 10 LIGHT EFFECT ---
    
    var lightEffect10 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos10 = new Vector3(0f,3.25f,-1.6f);
    // ..
    Vector3 dir10 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect10 = new PropInfo.Effect {m_effect = lightEffect10, m_position = pos10, m_direction = dir10 };
    
    // --- 11 LIGHT EFFECT ---
    
    var lightEffect11 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos11 = new Vector3(1.923f,3.25f,-1.6f);
    // ..
    Vector3 dir11 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect11 = new PropInfo.Effect {m_effect = lightEffect11, m_position = pos11, m_direction = dir11 };
    
    // --- 12 LIGHT EFFECT ---
    
    var lightEffect12 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos12 = new Vector3(-1.923f,3.25f,-1.6f);
    // ..
    Vector3 dir12 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect12 = new PropInfo.Effect {m_effect = lightEffect12, m_position = pos12, m_direction = dir12 };
    
    // --- 13 LIGHT EFFECT ---
    
    var lightEffect13 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos13 = new Vector3(3.817f,3.25f,-1.6f);
    // ..
    Vector3 dir13 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect13 = new PropInfo.Effect {m_effect = lightEffect13, m_position = pos13, m_direction = dir13 };
    
    // --- 14 LIGHT EFFECT ---
    
    var lightEffect14 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos14 = new Vector3(-3.817f,3.25f,-1.6f);
    // ..
    Vector3 dir14 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect14 = new PropInfo.Effect {m_effect = lightEffect14, m_position = pos14, m_direction = dir14 };
    
    // --- 15 LIGHT EFFECT ---
    
    var lightEffect15 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos15 = new Vector3(5.751f,3.25f,-1.6f);
    // ..
    Vector3 dir15 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect15 = new PropInfo.Effect {m_effect = lightEffect15, m_position = pos15, m_direction = dir15 };
    
    // --- 16 LIGHT EFFECT ---
    
    var lightEffect16 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos16 = new Vector3(-5.751f,3.25f,-1.6f);
    // ..
    Vector3 dir16 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect16 = new PropInfo.Effect {m_effect = lightEffect16, m_position = pos16, m_direction = dir16 };
    
    // --- 17 LIGHT EFFECT ---
    
    var lightEffect17 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos17 = new Vector3(7.666f,3.25f,-1.6f);
    // ..
    Vector3 dir17 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect17 = new PropInfo.Effect {m_effect = lightEffect17, m_position = pos17, m_direction = dir17 };
    
    // --- 18 LIGHT EFFECT ---
    
    var lightEffect18 = EffectCollection.FindEffect("Flood Light Short White") as LightEffect;
    Vector3 pos18 = new Vector3(-7.666f,3.25f,-1.6f);
    // ..
    Vector3 dir18 = new Vector3(0f,3f,-1f);
    // ..
    var propEffect18 = new PropInfo.Effect {m_effect = lightEffect18, m_position = pos18, m_direction = dir18 };
    
    
    // Apply effects to prop
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_effects = new PropInfo.Effect[] { propEffect1, propEffect2, propEffect3, propEffect4, propEffect5, propEffect6, propEffect7, propEffect8, propEffect9, propEffect10, propEffect11, propEffect12, propEffect13, propEffect14, propEffect15, propEffect16, propEffect17, propEffect18};
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_hasEffects = true;

     

     

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • So I used this script again :yes: And every time I do, I like to provide the code here.

    DKFXPk6XkAA8p8p.jpg

    http://steamcommunity.com/sharedfiles/filedetails/?id=1138693565

     

    Script for 3 lights (two high streetlights and one lower pedestrian light facing the sidewalk):

    // --- FIRST LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect1 = EffectCollection.FindEffect("Street Light Highway") as LightEffect;
    
    // Final position in prop
    Vector3 pos1 = new Vector3(0f,9.35f,-2.4f); 
    // this would be near the center of the prop facing the street, 9.35m above ground
    
    // Final direction in prop
    Vector3 dir1 = new Vector3(0f,-1f,0f);
    // pointing down 
    
    var propEffect1 = new PropInfo.Effect {m_effect = lightEffect1, m_position = pos1, m_direction = dir1 };
    
    
    // --- SECOND LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect2 = EffectCollection.FindEffect("Street Light Highway") as LightEffect;
    
    // Final position in prop
    Vector3 pos2 = new Vector3(0f,9.35f,2.4f); 
    // this would be near the center, on the other side, facing the street, 9.35m above ground
    
    // Final direction in prop
    Vector3 dir2 = new Vector3(0f,-1f,0f);
    // pointing down 
    
    var propEffect2 = new PropInfo.Effect {m_effect = lightEffect2, m_position = pos2, m_direction = dir2 };
    
    
    // --- THIRD LIGHT EFFECT ---
    
    var lightEffect3 = EffectCollection.FindEffect("Street Lamp") as LightEffect;
    Vector3 pos3 = new Vector3(-1f,3.5f,0f);
    // facing the sidewalk, 3.5m up
    Vector3 dir3 = new Vector3(0f,0f,0f);
    // not pointing (point light)
    
    var propEffect3 = new PropInfo.Effect {m_effect = lightEffect3, m_position = pos3, m_direction = dir3 };
    
    
    // Apply effects to prop
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_effects = new PropInfo.Effect[] { propEffect1, propEffect2, propEffect3};
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_hasEffects = true;

     

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • This is a dummy script for SvenBerlin to add 5 lights to a prop. The light positions and directions need to be changed to suit his model.

    // dummy script for 5 lights
    // written for SvenBerlin by AmiPolizeiFunk Okt. 2017
    // thx Boformer for the original script
    
    
    // --- FIRST LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect1 = EffectCollection.FindEffect("Flood Light Short Orange") as LightEffect;
    // Final position in prop (light source location)
    Vector3 pos1 = new Vector3(0f,16f,0f); 
    // pointing direction via unity vector
    Vector3 dir1 = new Vector3(0f,-2.00f,1f);
    
    // combine the position and direction into a variable
    var propEffect1 = new PropInfo.Effect {m_effect = lightEffect1, m_position = pos1, m_direction = dir1 };
    
    
    // --- SECOND LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect2 = EffectCollection.FindEffect("Flood Light Short Orange") as LightEffect;
    // Final position in prop
    Vector3 pos2 = new Vector3(-1.923f,16f,0f); 
    // Final direction in prop
    Vector3 dir2 = new Vector3(0f,-2.00f,1f);
    
    var propEffect2 = new PropInfo.Effect {m_effect = lightEffect2, m_position = pos2, m_direction = dir2 };
    
    
    // --- THIRD LIGHT EFFECT ---
    
    var lightEffect3 = EffectCollection.FindEffect("Flood Light Short Orange") as LightEffect;
    // ..
    Vector3 pos3 = new Vector3(-3.817f,16f,0f);
    // ..
    Vector3 dir3 = new Vector3(0f,-2.00f,1f);
    
    var propEffect3 = new PropInfo.Effect {m_effect = lightEffect3, m_position = pos3, m_direction = dir3 };
    
    
    // --- FOURTH LIGHT EFFECT ---
    
    var lightEffect4 = EffectCollection.FindEffect("Flood Light Short Orange") as LightEffect;
    // ..
    Vector3 pos4 = new Vector3(-5.751f,16f,0f);
    // ..
    Vector3 dir4 = new Vector3(0f,-2.00f,1f);
    
    var propEffect4 = new PropInfo.Effect {m_effect = lightEffect4, m_position = pos4, m_direction = dir4 };
    
    
    // --- FIFTH LIGHT EFFECT ---
    
    // Used light effect
    var lightEffect5 = EffectCollection.FindEffect("Flood Light Short Orange") as LightEffect;
    // Final position in prop
    Vector3 pos5 = new Vector3(1.923f,16f,0f); 
    // Final direction in prop
    Vector3 dir5 = new Vector3(0f,-2.00f,1f);
    
    var propEffect5 = new PropInfo.Effect {m_effect = lightEffect5, m_position = pos5, m_direction = dir5 };
    
    
    // Apply effects to prop
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_effects = new PropInfo.Effect[] {propEffect1, propEffect2, propEffect3, propEffect4, propEffect5};
    (GameObject.Find("Tool Controller").GetComponent<ToolController>().m_editPrefabInfo as PropInfo).m_hasEffects = true;

     

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In  

    Already have an account? Sign in here.

    Sign In Now


    • Similar Content

      • By heu3becteh
        Can you place props (like light and benches and whatever) in the Asset Editor precisely (be it grid snapping, display of coordinates or whatever)?
        For now the best I could do - is to check the coordinate values of props while placing them using Mod Tools, without being able to input them numerically.
        In Mod Tools there are a bunch of interesting properties found on...
        Tool Controller - PrefabInfo - BuildingInfo+Prop
        But I dunno if you can make changes made there affect the result?
        For now I just place Props and set colors as precisely as I can do it unprecisely (:
        Best regards.
      • By tariely
        Seeing how obsessed I am with lighting everything and the kitchen sink, a friend asked me if I could light Jenx QuaisdeSeine. I gamely tried. And found out it is way beyond my pay grade. The pieces swallow anything that is not the props specifically made by Jenx.
        My question is : is it possible to do that for light props (not lampadaires, they can be added easily and stay on see pic) but lightcones ? Would a kind soul do it for us if it is ? I was trying to use Jenx' own light cones -- the ones that go with his Pont Neuf. I'd added benches, also JENX-Porkissimo's, and you can see one peeking on the right ; Jenx made benches specifically for his pieces, OK, they can be used, but as for lightcones... naaah.


      • By airman15
        At the heart of any well-balanced city is an order legislated to guarantee the welfare of all who live inside it's jurisdiction. Law Enforcement is one of the most important branches to a government, ensuring safety to all. Even if it's a traffic ticket now and then or a donut shop being stormed. Your departments need a sturdy car and the Impala is the perfect fit! For when the going gets tough in the streets, these new cruisers are well-equipped to take on anything!
        About the Upload-
        This mod converts the Police Car into a modified Chevrolet Impala. There are 8 different liveries included, based on various police departments from the United States. The liveries included are not specific to any real cities, so they can blend into almost any setting within the game. The shields on each side are custom emblems from GM to promote the Impala as a police unit. Static props included.
        Dependencies?
        None required, but if you would like to see these units in action (besides their regular patrols), it's recommended to download the Lots of Riots mod, which will spawn more frequent uprisings that allow you to actually use the police dispatch tool!
      • By RaeFromStateFarm
        An asset i'm working on is having a weird light glitch that i first thought was because of the specular mask or something.
        I know it's most likely the police lights causing it, it only happens when the police lights are on and it seems the rotation of the lights light up certain parts of the car too.


        I'm guessing maybe the police lights are positioned awkwardly or in the center? 
        But i don't know where to begin in asset editor because when you position the police lights, you can't see the police lights while you're doing it like you can with headlights.
      • By RandyE
        Transfer here from one route to another. Transit and network enabled.
         ___           _                 
        | _ )_  _ ___ | |   ___  ___ _ __
        | _ \ || (_-< | |__/ _ \/ _ \ '_ \
        |___/\_,_/__/ |____\___/\___/ .__/
                                    |_|  
        City Bus Loop 1 - 3x2. 
        Capacity: 2500.
        Medium Wealth
        Plop Cost: 350
        Monthly Cost: 150
        Landmark Effect: 10,5
        Park Effect: 5, 5
        Air Pollution: 3, 2
        Water Pollution, 2, 2
        Maxis  Night Lighting
        Dependencies:
        Bus props used from: Glenni-buspack-
        RATP_Microbus-1
        RATP_Scania-Vest-HSD
        ORION-Old-MTAbus
        ORION-Old-MTAbusLongIsl
        Orion_VII_SacramentalRegionalTransit
         
        INSTALL to folder:
        C:\Users\<Username>\Documents\SimCity 4\Plugins
         
         
    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Season's Greetings!

    xmas popup.jpg

    Thank You for the Continued Support!

    Simtropolis relies mainly on member donations to continue operating. Without your support, we just would not be able to be entering our 15th year online!  You've really help make this a great community.

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running, so that we can help keep bringing SimCity players together to share our creations.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Echange.
    Make a donation and get one or all three discs today!

    stexcollection-header.png

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections