SC2Mapster Forums

Development > Triggers

Doodads not spawning....

  • 9 posts
    #1 Dec 25, 2012 at 16:37 UTC - 0 likes

    So I have been having the hardest time with doodads spawning through triggers.

    Here's the code though it's pretty basic stuff:

    //Start Battle
        Options: Action, Create Thread
        Return Type: (None)
        Parameters
            Camera <Camera Object>
            BattleID <Real>
            Player <Integer>
            Enemy unit type <Game Link - Unit>
            Area <Region>
            Playable area <Region>
        Grammar Text: Start Battle(Camera, BattleID, Player, Enemy unit type, Area, Playable area)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            ranint = 0 <Integer>
            ranpoi = No Point <Point>
            int = 0 <Integer>
            Enemy Key = ("En" + (String(BattleID) with Any Precision decimal places)) <String>
        Actions
            Variable - Modify Current BID: + 0.1
            Animation - Remove Tree - Haven doodads in the Playable area region
            Animation - Remove Curtain (LOS BLOCKER) - Aiur - doodads in the Playable area region
            General - Wait 0.05 Real Time seconds
            General - Repeat (Actions) 6 times
                Actions
                    Variable - Set ranint = (Random integer between 0 and 5)
                    Variable - Set ranpoi = (Random point in Playable area)
                    Variable - Set Point[int] = ranpoi
                    Actor - Create actor Deformers[ranint] at point ranpoi
                    Variable - Set Actor[int] = (Last created actor)
                    Variable - Modify int: + 1
            General - Wait 0.15 Real Time seconds
            Spawn Doodads(Playable area)
            General - Wait 0.25 Real Time seconds
            Random Weather(Area)
            General - Wait 0.25 Real Time seconds
            Player Group - Pick each player in (Active Players) and do (Actions)
                Actions
                    Visibility - Create a visibility revealer for player (Picked player) within Area
                    Camera - Pan the camera for player (Picked player) to (Camera target) over 0.0 seconds with Existing Velocity% initial velocity, 10.0% deceleration, and Do Not use smart panning
                    Camera - Apply Camera for player (Picked player) over 0.5 seconds with Existing Velocity% initial velocity, 10.0% deceleration, and Don't Include Target
            General - Switch (Actions) depending on Player
                Cases
                    General - If (2)
                        Actions
                            Unit - Move Player Unit[Player] instantly to Move from here ENEMY Forest (Blend)
                            Unit - Make Player Unit[Player] face (Facing of Enemy Spawn Forest) over 0.5 seconds
                Default
                    Unit - Move Player Unit[Player] instantly to Move from here Forest (Blend)
                    Unit - Make Player Unit[Player] face (Facing of Player Spawn Forest) over 0.5 seconds
            Unit - Create 1 Enemy unit type for player 5 at Move from here ENEMY Forest using point facing (No Options)
            Unit - Make (Last created unit) face (Facing of Enemy Spawn Forest) over 0.5 seconds
            Data Table - Save (Last created unit) as Enemy Key in the Global data table
            General - Wait 1.0 Real Time seconds
            General - Switch (Actions) depending on Player
                Cases
                    General - If (2)
                        Actions
                            Unit - Order Player Unit[Player] to ( Move targeting Enemy Spawn Forest) (Replace Existing Orders)
                Default
                    Unit - Order Player Unit[Player] to ( Move targeting Player Spawn Forest) (Replace Existing Orders)
            Unit - Order (Last created unit) to ( Move targeting Enemy Spawn Forest) (Replace Existing Orders)
            Unit Selection - Select Player Unit[Player] for player Player
            General - Wait 0.5 Real Time seconds
            Unit Group - Pick each unit in (Any units in Area owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
                Actions
                    Unit - Make (Picked unit) Uncommandable
    //Spawn Doodads
        Options: Action, Loop, Create Thread
        Return Type: (None)
        Parameters
            Area = No Region <Region>
        Grammar Text: Spawn Doodads(Area)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            ranint = 0 <Integer>
            int = 0 <Integer>
            ranpoi = No Point <Point>
        Actions
            General - Switch (Actions) depending on Area
                Cases
                    General - If (Playable area forest)
                        Actions
                            General - Repeat (Actions) 25 times
                                Actions
                                    Variable - Set ranpoi = (Random point in Area)
                                    Actor - Create actor Tree - Haven at point ranpoi
                            General - Repeat (Actions) 50 times
                                Actions
                                    Variable - Set ranpoi = (Random point in Area)
                                    Actor - Create actor Curtain (LOS BLOCKER) - Aiur - at point ranpoi
                            Animation - Remove Tree - Haven doodads in the Road region
                            Animation - Remove Tree - Haven doodads in the Start You F region
                            Animation - Remove Tree - Haven doodads in the Start Enemy F region
                            General - For each integer int from 0 to 5 with increment 1, do (Actions)
                                Actions
                                    General - If (Conditions) then do multiple (Actions)
                                        If Then Else
                                            General - Else if (Conditions) then do (Actions)
                                                Else If
                                                    (Point[int] is in Road) == True
                                                Then
                                                    Actor - Send message "Destroy Immediate" to actor Actor[int]
                Default
    

    Am I maybe doing something wrong? I am also using the weather system made by Meta.

    I have no idea because both of them have worked at one point and then one by one doodads stopped spawning either:

    A. correctly

    or

    B. at all.

    EDIT: umm...I seem to have figured it out...for some reason I need the whole map revealed before they will spawn correctly.

    Does anyone know why this is or even how to fix it? It's really starting to irritate me.

    Last edited Dec 25, 2012 by Yaksmanofage
    #2 Dec 26, 2012 at 20:09 UTC - 0 likes

    @Yaksmanofage: Go

    Anyone? This is very annoying as some of my game features require a black mask....

    #3 Dec 30, 2012 at 22:25 UTC - 0 likes

    @Yaksmanofage: Go

    Still nothing, anyone?

    #4 Dec 31, 2012 at 12:36 UTC - 0 likes

    Have you tried making them units instead of doodads? If you disable click and highlight in the unit's actor you can make it behave almost exactly like a doodad.

    My Projects:
    Malum Ruina: SC2Mapster
    Eternal Exile: SC2Mapster
    Spine Crawler Madness: SC2Mapster
    Xeno Crisis: SC2Mapster

    #5 Jan 01, 2013 at 01:00 UTC - 0 likes

    @BasharTeg: Go

    I was considering that it's just a pain in the butt to do as I plan to make use of many doodads at once.

    I'll keep it in mind but I am hoping for an option that involves fixing the doodads spawning.

    #6 Jan 01, 2013 at 01:08 UTC - 0 likes

    @Yaksmanofage: Go

    You could also try revealing the map for a neutral player to see if that works. I don't see any reason why it would be player-dependent unless it was some kind of glitch with the actors...

    #7 Jan 01, 2013 at 01:58 UTC - 0 likes

    @BasharTeg: Go

    I actually did. I, personally, need the map revealed (if even for a short period) before they will spawn. Similarly setting to "grey mask" instead of "black mask" works.

    As well this is a problem across the board meaning I have tried other maps and the same thing happens.

    #8 Jan 02, 2013 at 23:02 UTC - 0 likes

    I haven't checked this at all to see if this works, and i'm not the best with doodad spawning, but after you spawn the actor i think you also need to spawn the actor model for it and attach it, in order for it to exist out of sight. If this doesn't work don't blame me. Sorry i'm not helpful at all.

    #9 Jan 03, 2013 at 06:31 UTC - 0 likes

    @willuwontu: Go

    Actually the problem is they aren't spawning at all. However I'll give it a try sometime tomorrow and get back to you.

    EDIT: been real busy, will get around to it eventually.

    Last edited Jan 05, 2013 by Yaksmanofage
  • 9 posts

You must login to post a comment. Don't have an account? Register to get one!