title: Netlogo Prisoners Dilemma runtime and compiletime errors
body: <p>I'm currently creating a code for the prisoner's dilemma game. In my adoption, the turtles represent logging companies and the patches are trees, the two companies are competing for the trees but can cooperate by regrowing them.</p>
  
  <p>The problem I am having, is that the code below keeps creating a runtime error because of the ask turtle, it states:</p>
  
  <p>Only the observer can ASK the set of all turtles.
  error while turtle 0 running ASK
    called by procedure DEFOREST</p>
  
  <p>called by Button 'go'. However, if I get rid of the ask turtles segment then it creates a compile time error stating 'I can't use tricks in a turtle/patch context because tick is an observer only. So what can I do to fix this? I can temporarily take it out of my go function whilst I build on my code but at some point, I will need to invoke the code in the go function.</p>
  
  <p>;; Action function
  to deforest</p>
  
  <p>ask turtles [
    ask patch-at 0 0 [ if pcolor = green [ set pcolor brown set money money +          50 set deforestation true ] 
      ]
    ]<br>
  end  </p>