*lightbulb blinks on*
OK next problem. I found out that spawn's second call variable sets the owner of the spawned object. I had this idea that i could block summoning of the portals by
- Code: Select all
if (Owner==None)
Destroy();
and then set the owner when the gun spawns the Portal. This works except that when i summon the portal with summoning enabled (its a config bool var), the first summon accesses none, and the object won't summon. When i try again tho, it works. When the summoning is disabled there is no problem and all summons are blocked.
Code:
- Code: Select all
if ((Self.Owner!=None && !Controller.bAllowSummon) || controller.bAllowSummon)
{
//summon code for all the individual portal elements
}
else
{
//message to summoner about cant summon this item.
destroy();
}
as you can see, i have all the variables stored in a controller actor, and that actor has the config (file) in the definition. All settable vars are set in te controller.