🛈 Announcement
Greetings! Far Cry forums are now archived and accessible in read-only mode, please go to the new platform to discuss the game.
  1. #1

    Scripting possibilities

    So I played around with the new scripting objects last night, and thought I'd start a thread about what I've been able to figure out and the different ways they can be used. If anyone else has some bright ideas of things I missed or interesting effects that can be achieved using them, by all means, post what you got!

    So first of all, you've got the three types of triggers. The Trigger Volume is, I'd suspect, the most basic and easy to use. You put down the box, get the size and shape the way you want it, and point it to the script you want to activate. The player walks into the volume, the linked script fires. Easy.

    Second is the Trigger Event, which lets you fire scripts when certain events happen. For example, you seem to be able to activate a linked script when certain enemies die, or when a new Wave of enemies starts. I haven't played with this one extensively, but I think wise usage of it will help us better control the order when enemies spawn in a level or special effects that occur when you do things like killing a boss character.

    Finally, you have the Trigger Look At, which fires when you look at it, as near as I can tell. The radius you can set seems to be how close you have to be before looking at the trigger will fire the linked script. For reference, I think 5 units is about the size of one of the gray default ground squares (probably the same as the coordinate system.) This one I had some trouble with using in testing. It didn't like to be too close to a surface, and sometimes it wouldn't fire at all for reasons I couldn't determine. If anybody's got more info, please post it below.

    And then you've got the most important object, the base Script object. This is the workhorse, and you need one of the (currently) three trigger objects linked to one to activate it, unless I missed something. (I'd really like it if a triggerless Script object could be activated like a button, but alas, that's not the world we live in right now.) You can do a lot of different things with the Script object, including spawning enemies, objects, changing the time of day, and teleporting the player around the map. Check the video Fallen Ninja posted in his thread for a good tutorial on how to set up a player teleport (with appearing text as well!)

    The objects and enemies that I've tried to spawn with a script are nice and invisible until triggered. I can't wait to be playing a map and have a flamethrower guy spawn right behind me after I enter a dead end corridor. I haven't seen that you can repeatedly spawn the same enemy or object though. Unfortunately, only certain object types seem to be able to be spawn. When I tried, I got a weapons, vehicles, explosive objects, ammo, health, visual effects, and sound effects all to spawn with Spawn Object (spawning short lived sound effects will be great for spooky maps with jump scares!) And as Fallen Ninja pointed out in his above mentioned video, you can also spawn the generic letters to write out appearing and disappearing messages (not too long, though; there are only so many available slots in each script). Another possibility is scripted destruction with the spawnable explosion FX and a short lasting damage player or kill effect.

    Unfortunately, you don't seem to be able to spawn everything. I couldn't get any statics or dynamic doors to spawn/unspawn, which I was hoping to use to create locked doors or openable sliding hi-tech doors, and the generic objects I tried (other than letters, which I didn't think to try) don't work either.

    I see a few uses for the set time script function too. My first thought is that we can finally have dark underground areas while the rest of the map has daytime. Just put in a trigger volume at the entrance to your underground area that sets the time to night, and have a second leading back out of the underground area that sets the time to day again. Just make sure to put them in the correct order so that the player can't turn around and go back out into the outside area while it's night. Combine with an underground reflection volume to complete the look.

    The other thing with changing the time of day is that you can set how long it takes to transition, up to 60 seconds. Could be good for horror maps where it suddenly and very quickly becomes night. On the other hand, I'm waiting for the first map that includes a working day-night cycle over time. You could have a 10 minute MP map that starts of day and descends into night or vice-versa throughout the course of play.

    Another function that would be useful is the toggling objective markers. I don't use them much, because previously they'd all be visible from the start, but now you can have them pop up one by one, leading your player through the map. Kill a bounty target, spawn the marker at the next one, etc. Of note, though, is that as far as I can tell, you have to toggle off the ones you don't want to be visible at the start of the map.

    A good way to do that is to have the player start in a trigger volume that sets you initial conditions for the map. Control who is spawned, what objective markers are visible, the start of time of day, however you want things to be when map is started.

    In fact, since you can fire multiple events from the same trigger, make sure to make things classy. Don't just teleport the play. Spawn a sound at the same time to be the teleportation sound and a swirly energy visual FX to be the teleporter's flash of light. Make it cool.

    Another tip is that I haven't found a way to have one script activate another script, or for a trigger to activate multiple scripts. The only work around for that that I can think of is to have two or more triggers fire at the same time, have them que behind one another, and maybe have subsequent scripts start with a delay if you want more things to happen than the script has options for.

    And I think that's all I have. Anybody have more notes on things you can do with the triggers and scripts or neat tricks you can pull off with them?
    Share this post

  2. #2
    Spawn objects, yes any object other than those listed under objects 😂. At least we have something a guess.
    Share this post

  3. #3
    You can spawn vehicles, particles, decals, sounds, animation points, pickups, weapons, damage regions, some vegetation, explosives, and most importantly small destructible generic shapes (like the 100x100 cube, 200x200 floor, or ball large from FC5 > Commercial > Supplies)
    Share this post

  4. #4
    The proper way to spawn an explosion is to:

    1- Set a trigger

    2- Link to script

    3- Script 2 actions: Spawn Fire (of your choice) and Explosions sound FX (of your choice)

    Make sure they are NOT Queued so they trigger at the same time.

    You can unspawn the flame with another trigger in the same location by scripting a delay and unspawn, if you want the explosions to not continue to burn.
    Share this post

  5. #5
    Does scripting count towards FX budget?
    Share this post

  6. #6
    I don't think so graw
    Share this post