This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk
Forum rules
Forum rules
Tag the Player who enters an Area.
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
- TheOriginalCj
- Moderator

- Posts: 177
- Joined: Tue Mar 15, 2016 10:28 pm
- Title: Lifetime Sentence to SF Wiki
- SFD Alias: RedneckJed
- Started SFD: PreAlpha 1.1.0
- Location: USA
- Gender:
- Contact:
Tag the Player who enters an Area.
In an AreaTrigger, is the Caller the IObject/IPlayer who enters/leaves the AreaTrigger? If so, how would I add a tag to them if I wanted to trigger a certain event to happen to that player at a later time?
0 x
Superfighters Wiki Founder
The Superfighters Wiki
Join the Wiki!
The Superfighters Wiki
Join the Wiki!
Danger Ross wrote: What are you doing here wiki-slave?! GET BACK TO WORK!
- Gurt
- Lead Programmer

- Posts: 1887
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Gender:
- Age: 36
You can't "tag" objects using a custom Tag property. Instead save the unique ID of the object to a hashset, list, array or variable (whatever your preferred method is) and check if you have stored the unique ID in those variable(s).
0 x
Gurt
- TheOriginalCj
- Moderator

- Posts: 177
- Joined: Tue Mar 15, 2016 10:28 pm
- Title: Lifetime Sentence to SF Wiki
- SFD Alias: RedneckJed
- Started SFD: PreAlpha 1.1.0
- Location: USA
- Gender:
- Contact:
Alright, but I will be calling the variable I'll be "tagging" in a seperate function, does the API support a type of global variable in its current state?
0 x
Superfighters Wiki Founder
The Superfighters Wiki
Join the Wiki!
The Superfighters Wiki
Join the Wiki!
Danger Ross wrote: What are you doing here wiki-slave?! GET BACK TO WORK!
- Gurt
- Lead Programmer

- Posts: 1887
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Gender:
- Age: 36
Sure.
Just declare the variables outside your functions. Use static if you need to cross-access them from inside other classes.
Just declare the variables outside your functions. Use static if you need to cross-access them from inside other classes.
Code: Select all
bool TestA = false;
static bool TestB = false;
public void OnStartup()
{
TestA = true;
TestB = true;
}
public class Foo
{
public void Bar()
{
TestB = true;
}
}
0 x
Gurt
- TheOriginalCj
- Moderator

- Posts: 177
- Joined: Tue Mar 15, 2016 10:28 pm
- Title: Lifetime Sentence to SF Wiki
- SFD Alias: RedneckJed
- Started SFD: PreAlpha 1.1.0
- Location: USA
- Gender:
- Contact:
Excellent. It's a bit different from source C where your PC doesn't like you if you do that. Thanks Gurt!Gurt wrote:Sure.
Just declare the variables outside your functions. Use static if you need to cross-access them from inside other classes.
Code: Select all
bool TestA = false; static bool TestB = false; public void OnStartup() { TestA = true; TestB = true; } public class Foo { public void Bar() { TestB = true; } }
0 x
Superfighters Wiki Founder
The Superfighters Wiki
Join the Wiki!
The Superfighters Wiki
Join the Wiki!
Danger Ross wrote: What are you doing here wiki-slave?! GET BACK TO WORK!