Author Topic: Scripting questions Updated  (Read 8867 times)

FFSnipe

  • Posts: 52
  • Maze Master
    • View Profile
Scripting questions Updated
« on: January 19, 2014, 06:54:28 PM »
As the title says, is there a max number of scripts that you can have on a single map? I am currently working on a maze, and I want all areas covered by default, and as you progress, it uncovers paths. that way you cant see all the sections surrounding you even if they arent actually connected to the path you are on. before anyone says it, I know its a hell of a lot of work. But it will be worth it in the end.
« Last Edit: February 04, 2014, 04:23:17 PM by FFSnipe »
Spoils to the victor...

Enjay

  • Posts: 47
  • Maggot Crusher.
    • View Profile
Re: max number of scripts?
« Reply #1 on: January 20, 2014, 12:59:31 AM »
There is no practical limit to placing scripts in the editor (Source: I just copied and pasted 10k+ scripts), I see no technical reason why connecting and using those scripts would cause problems. The only thing to be careful of is that one single trigger does not cause too many actions, as that could cause noticeable stuttering. As long as it's just "Enter area, reveal area" it shouldn't be too hard for a computer to handle.
Every time I post I get nervous because I feel like the devs are judging me.

FFSnipe

  • Posts: 52
  • Maze Master
    • View Profile
Re: Scripting questions Updated
« Reply #2 on: February 04, 2014, 04:25:45 PM »
Just wondering if there is a way to make doodads partially transparent using scripts. I modified all the collisions of wall doodads, and I was hoping that when a player was behind a wall, it would turn transparent. its a pet peeve of mine to not be able to walk behind a wall, so i changed them.
Spoils to the victor...

NekoBaron

  • Posts: 124
  • Scripting Wizard
    • View Profile
Re: Scripting questions Updated
« Reply #3 on: February 04, 2014, 07:18:24 PM »
If you decide its more effort than its work I think it should be possible to make an invisible doodad with priority to show on top and have it wipe the minimap in a blank colour or even an intentionally confusing pattern. You could see over the walls though but the minimap would be useless to cheat with.

As for being behind doodads its just one thing of the engine, far as I know there isn't a script to do it automatically to a doodad but you could make your own wall doodads and change their state to show a transparent version, you'ld need a lot of triggers though and its not ideal in multiplayer at times.

FFSnipe

  • Posts: 52
  • Maze Master
    • View Profile
Re: Scripting questions Updated
« Reply #4 on: February 04, 2014, 07:28:29 PM »
i actually started to make a duplicate set of doodads with 128 transparency. im going to just place in the same spots standard ones and have a script to hide the standard ones when the player goes behind the wall. thus only the transparent ones will show. thank you for the quick response.
Spoils to the victor...

NekoBaron

  • Posts: 124
  • Scripting Wizard
    • View Profile
Re: Scripting questions Updated
« Reply #5 on: February 04, 2014, 07:48:21 PM »
Well I was thinking if your making a 2nd wall set you can use doodad states to change their animation sets (which can be a single frame), so you dont need 2 doodads overlapping everywhere. You can reference the original graphics file and your own ones in a doodad.

FFSnipe

  • Posts: 52
  • Maze Master
    • View Profile
Re: Scripting questions Updated
« Reply #6 on: February 04, 2014, 08:21:38 PM »
aaaaaahhhhh. i didnt even think of that. nice nice.  :o so the script would be something like Area Trigger that is set to enter or leave, linked to a shape that is set off by the player only. then a change doodad state script linked to the area trigger?

(sorry, i am still learning scripting. but I am hoping that this is correct.)
Spoils to the victor...

Amran

  • Posts: 20
  • Maggot Crusher.
    • View Profile
Re: Scripting questions Updated
« Reply #7 on: February 05, 2014, 12:12:52 AM »
Could problems arise in multiplayer from scripting it this way? I haven't looked into it much, but if the scripts work as I assume, cases like this could come up:

-Player 1 enters area behind wall, causing OnEnter to fire and the wall to change to translucent
-Player 2 enters area behind wall, causing OnEnter to fire and no change to the wall as it's already translucent
-Player 1 leaves area behind wall, causing OnLeave to fire and the wall to change to opaque
-Player 2 would then be behind a non translucent wall?
« Last Edit: February 05, 2014, 03:29:56 AM by Amran »

FFSnipe

  • Posts: 52
  • Maze Master
    • View Profile
Re: Scripting questions Updated
« Reply #8 on: February 05, 2014, 01:10:42 AM »
hrm.... i believe you are correct. my way would cause problems. if a player was already behind a wall and another walked into the area, it would make the wall non-transparent...

eh. i need to figure out the best way to do this  :o
Spoils to the victor...

FFSnipe

  • Posts: 52
  • Maze Master
    • View Profile
Re: Scripting questions Updated
« Reply #9 on: February 05, 2014, 01:21:39 AM »
Perhaps a change and check variable. when a player enters the area, add 1, when he leaves the area, subtract 1. when another player enters add another 1 etc etc. and only allow the doodad state to be non-transparent if the variable is zero?  any other variable (1-4) would cause the doodad state to be the transparent state.

would this work? it seems confusing as hell, and I may need help linking it all together  :-\ but it theory, it sounds like it would work.

EDIT: got it working woo! 9 script entities lol. but it works. for single player at least. everything seems correct, so i would assume that it would work for multiple players as well.
« Last Edit: February 05, 2014, 01:41:20 AM by FFSnipe »
Spoils to the victor...

Amran

  • Posts: 20
  • Maggot Crusher.
    • View Profile
Re: Scripting questions Updated
« Reply #10 on: February 05, 2014, 03:34:05 AM »
Yep, sounds like a workaround if you don't mind the extra scripts!

If you make each wall a prefab I believe the scripts will be hidden when placing them in the editor.