DetectMagic(vector casterLocation){
distance = Distance( casterLocation, myLocation)/100;
distance = clamp(distance, 1, 30);
For(timer=0 to 2) {
intensity = lerp(10000,0, alpha)
intensity /= distance;
PointLight.SetIntensity(intensity);
}
}
DetectMagic(vector casterLocation) {
distance = Distance(casterLocation, myLocation)
if (distance < 500) {
PointLight.SetColor(red);
} else if (distance < 1000) {
PointLight.SetColor(gold);
} else if (distance < 3000) {
PointLight.SetColor(blue);
}
if (distance < 3000) {
PointLight.SetIntensity(50000)
Sleep(3);
PointLight.SetIntensity(0);
PointLight.SetColor(black);
}
}
OnKeypressC() {
For each actor in GetAllActorsWith BPI_DetectMagic:
actor.DetectMagic(myLocation);
}
SummonCoin
- This has no arguments but returns a int
-
- Compile and save and it shows up in the interface.
-
- Double click on this to add this function.
-
- Back in the FirstPerson Character
- I added a SummonCoin input action (Keypress x)
- I change the Cast interaction to DetectMagic.
- And Added the following function
-
- Note this uses the function
DoesImplementInterface
- And I am looking at ALL of the actors in the level, Probably VERY BAD.
- You can also add the interface to the Level.
- Open the level then open the class settings.
- Add the BPI
- I add a function that will dim the skylight when detect magic is cast.
-
- The documentation points out be you have two different instances of the BPI functions
-
- The top one is intended to call the your own function.
- The bottom one is intended to call another intsances' function
-