Can't get logic_auto to work with emp_vehicle_spawner

Discussion in 'Mapping' started by Soylent, Apr 17, 2011.

  1. Soylent

    Soylent Member

    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    I'd like to place some free jeeps in my map to get it off to a flying start, but it just crashes the game. Any ideas?

    I have a logic_auto configured thusly:

    Code:
    My Output: OnNewGame
    Target Entity: imp_free_jeep0
    Target Input: SpawnVehicle
    Parameter: imp_jeep_preset
    Delay: 0.00
    Only once: No
    I have also tried using outputs OnMapSpawn, OnMultiNewMap, OnMultiNewRound. They all crash when the jeeps are spawned.

    The imp_free_jeep0 entity is configured like so:

    Code:
    Start enabled: Yes
    Automatically respawn?: No
    Costs resources?: No
    imp_jeep_preset looks like this:

    Code:
    Faction: Brenodi empire
    Spawn point: false
    Cost: 0
    Chassis: BE jeep
    Engine: Jeep standard engine
    Armor: Plain armor
    Front armor plates: 0
    Rear armor plates: 0
    Left armor plates: 0
    Right armor plates: 0
    Weapon 1: type:  No weapon
    Weapon 1: mode: Primary
    Weapon 1: groups: 0
    [...]
    Weapon 8: type:  No weapon
    Weapon 8: mode: Primary
    Weapon 8: groups: 0
    
     
  2. Metal Smith

    Metal Smith Member

    Messages:
    4,520
    Likes Received:
    3
    Trophy Points:
    0
    if it automatically repeats, it's crashing / failing because it's trying to spawn jeeps inside one another.

    vehicle_spawner should have a parameter to make the vehicle automatically respawn when destroyed. If you want several jeeps, they will each need their own spawner, though they can use the same preset.

    You'd be better off using a different trigger mechanism though. Either automatic or with a trigger_multiple brush.

    but yeah, with auto respawn, the vehicles should automatically spawn when the map starts, and will keep respawning only after they die.
     
    Last edited: Apr 17, 2011
  3. Chris0132'

    Chris0132' Developer

    Messages:
    9,482
    Likes Received:
    0
    Trophy Points:
    0
    It's onmapspawn not onnewgame.

    If it crashes it's an error with your vehicle spawner, not the logic_auto.

    Although you could try adding a delay, the game might not like having the vehicles spawn on the same frame as the map loads. Add a 5 second delay to the output.

    Be aware also that when you use vehicle spawners, it doesn't precache the vehicle models, so the game will freeze for a few seconds while it loads the models.
     
    Last edited: Apr 17, 2011
  4. Soylent

    Soylent Member

    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    I don't see why it would be repeating, but I'll make doubly by having only once enabled on the logic_auto.

    I don't want them to behave that way. I want just a one-off gift of a few jeeps to each team. Do you think it would be a robust solution to set them to automatic, then kill the vehicle presets with a trigger_once brush when players go to grab them?

    Thanks.

    Pretty sure that's not the problem; onmapspawn crashes the game just as you're about to get off the loading screen, the other options crash after the game has started and the comm vehicle has already been spawned.

    Freezing a bit while you select the comm is probably tolerable.
     
    Last edited: Apr 17, 2011
  5. Chris0132'

    Chris0132' Developer

    Messages:
    9,482
    Likes Received:
    0
    Trophy Points:
    0
    Not sure then, I can only think your vehicle preset is badly configured (likely due to shitty wiki information) as I used logic_autos with onmapspawn and a delay in order to start spawners in my map.
     
  6. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Hasn't someone made a prefab system somewhere that he could dump into his map to test it out?
     
  7. Metal Smith

    Metal Smith Member

    Messages:
    4,520
    Likes Received:
    3
    Trophy Points:
    0
    Not one I haven't fucked with to make it spawn an armory that shoots artillery shells.
     
  8. Soylent

    Soylent Member

    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Got it working; here's what I've have discovered:

    It's OK to place the emp_vehicle_spawner exactly at ground level if the ground is perfectly flat. Jeeps that are inside walls or inside each other do not cause a crash; they simply don't get spawned.

    If you don't tick the "once only" check box on logic_auto outputs events which should only fire ones(like onmapspawn) apparently will fire more than once and crash the game.

    Now I'm looking to solve the mostly cosmetic problem of keeping the jeeps from moving around when they spawn(they lurch forward a few meters whether you drop them or spawn exactly at ground level).
     
    Last edited: Apr 17, 2011
  9. Chris0132'

    Chris0132' Developer

    Messages:
    9,482
    Likes Received:
    0
    Trophy Points:
    0
    If they are only spawning once, you can create a trigger_vphysics_motion set up to freeze vehicles inside it, then you can disable it a few seconds after the vehicles spawn.
     
  10. Soylent

    Soylent Member

    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    That works.
     

Share This Page