t.tutiya
(t.tutiya)
1
If I want to toggle SwitchA when 10 seconds have elapsed from the start of the game, what should I specify as the Agent?
In this case, there is no instigator to toggle the switch
The following code seems redundant(Sorry, Not tested.).
TeamCollection := GetPlayspace().GetTeamCollection()
if:
Teams := TeamCollection.GetTeams()
Agents := TeamCollection.GetAgents[Teams[0]]
Agent := Agents[0]
then:
SwitchA.ToggleState(Agent) #SwitchA : switch_device
Thank you.
1 Like
GraemeBB
(GraemeBB)
2
I’d probably do this, just grabbing the first player in the game:
if:
Player:player = GetPlayspace().GetPlayers()[0]
PlayerAgent:agent = agent[Player]
then:
SwitchDevice.ToggleState(PlayerAgent)
1 Like
Ep8Script
(Ep8Script)
4
You don’t need to do PlayerAgent:agent = agent[Player]
here btw - player
inherits from agent
, so it can be passed anywhere expecting an agent
2 Likes
t.tutiya
(t.tutiya)
5
Thank you!
Here’s the final ver.(And tested.)
if:
Agent := GetPlayspace().GetPlayers()[0]
then:
SwitchDevice.ToggleState(Agent)
system
(system)
Closed
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.