Effects: Show "ghost" buildings?

Discussion in 'Mod Support' started by cola_colin, January 11, 2015.

  1. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    So I am playing around with server scripting and one of the things I am interested in is to spawn random effects into the world. Spawning premade effects isn't very hard and kinda fun so far.
    Now I am wondering how the effect editing works. I can see effects are defined in json and pfx files, but I have very little knowledge of this stuff so far. I am wondering if it is possible to create "ghost" buildings.
    I've seen that the commander landing is using an astreus model as a particle, so it seems that it is possible to use random units as particles for effects.
    Is it possible to define an effect that is totally static and just shows a particle at a given location in a half transparent manner? I'd like to have a marker "build here" basically. I am thinking to create such an effect once per second in a given location until the player builds the building there.

    In general: Has somebody looked at this system a bit more already and has ideas for interesting usecases given the ability to spawn any effects anywhere via a scripting system?
    xankar and dom314 like this.
  2. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    The particle system has an option for using a mesh as the particle. If you can find a way to cause the system to spawn an effect with scripting on the server, then this kind of thing should definitely be possible.
  3. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Colin asking a question?

    Waaaaaaaaaaaaaaaaaaaaaaaat?

    But as Dom said, there is a mesh option and I believe there is an option to set a papa file as the mesh, but unfortunately this is the one thing in the effects guide that is unfinished not even there.

    EDIT: just realized this is a pretty old question
  4. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    12 days is old?

    The effects system is capable of doing this, though if you want a transparent team colored unit particle you'd have to write a new shader as the existing meshParticle_unit is opaque like a normal unit.

    Not really any way to spawn effects via server scripting that I know of though.
    stuart98 likes this.
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    [​IMG]

    I am fine with a transparent, non colored ghost.
  6. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    Ah, good. When I originally added the commander spawn effects it was through C++ code.

    You'll need an effects entity Json file for each building type you want to preview and a pfx file with that building's model and diffuse texture.

    Thinking about it you might still need a custom shader, or be okay with the buildings looking a little odd since the diffuse textures have that alpha in them.
    cola_colin likes this.

Share This Page