Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Help with variable ints!
You're getting there, but there's still things to do to get it to work. Firstly, you do not need to name anything in the map BarrelCheck because this is just the integer's name and is only referenced in the script. Secondly, you must input your functions inside the if-statements. Where SR put the comments, you must put the script that is supposed to happen in that situation.
For example, instead of calling the function for when the container is cleaned or not, call ContainerOnBarrelCheck (don't forget to update the parameters if you do). Inside that function you put what happens when it is clearned inside the == 1 check, and what happens when it is not cleaned inside the other. What will happen is that only one of these if-statements are going to run when you use the item on the barrel, but which one it is is determined by what has happened before.
When you clean your barrel, run SetLocalVarInt("BarrelCheck", 1); to update the int. If you use the container on the barrel after this script has been run, it will execute the first if-statement instead of the second.
(This post was last modified: 03-19-2014, 01:58 PM by Mudbill.)
|
|
03-19-2014, 01:57 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Help with variable ints!
(03-19-2014, 01:57 PM)Mudbill Wrote: You're getting there, but there's still things to do to get it to work. Firstly, you do not need to name anything in the map BarrelCheck because this is just the integer's name and is only referenced in the script. Secondly, you must input your functions inside the if-statements. Where SR put the comments, you must put the script that is supposed to happen in that situation.
For example, instead of calling the function for when the container is cleaned or not, call ContainerOnBarrelCheck (don't forget to update the parameters if you do). Inside that function you put what happens when it is clearned inside the == 1 check, and what happens when it is not cleaned inside the other. What will happen is that only one of these if-statements are going to run when you use the item on the barrel, but which one it is is determined by what has happened before.
When you clean your barrel, run SetLocalVarInt("BarrelCheck", 1); to update the int. If you use the container on the barrel after this script has been run, it will execute the first if-statement instead of the second.
AddLocalVarInt is better IMO.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-19-2014, 02:02 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Help with variable ints!
Yeah, I suppose. I just like to use Set when I don't need to add so I don't add unnecessary values.
In this particular case, I would use a boolean though.
|
|
03-19-2014, 02:26 PM |
|
|