Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help String reference within constant name (Advanced)
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: String reference within constant name (Advanced)

Thank you for taking your time ^^
I just hope it wasn't wasted. Well, I'm sure I can learn something from this either way.

The RemoveItem I had was just for the example. My actual situation involves a 5x5 grid of rooms, where each room has a door on each wall (n, s, e, w). I haven't quite gotten the hang of arrays yet, so I made a boolean for each room+dir (Ex: x1y1_s, x5y5_n etc). For each room, I have an area named "area_room" which is used to trigger what doors should open in each room. It's quite difficult to explain without explaining how the whole puzzle looks, works and solves.

The script you posted is slightly above my experiences, but I can make sense of it. Basically I already have the booleans I need, but I need a way of telling the code which boolean to change and which not to. I can do this with a bunch of if-statements or a very long switch-statement but I feel that's unnecessary and I'd rather use a more compact method. If I could input the boolean that has the name (excluding dir) of the area it's associated with, then perhaps I could also add the dir on top of that name before asking the question of what boolean it is.

(This post was last modified: 03-09-2014, 04:51 PM by Mudbill.)
03-09-2014, 04:50 PM
Find


Messages In This Thread
RE: String reference within constant name (Advanced) - by Mudbill - 03-09-2014, 04:50 PM



Users browsing this thread: 1 Guest(s)