Index: code/branches/core5/data/levels/events.oxw
===================================================================
--- code/branches/core5/data/levels/events.oxw	(revision 5882)
+++ code/branches/core5/data/levels/events.oxw	(revision 5883)
@@ -29,4 +29,11 @@
 
 
+
+    <!--
+      Begin of the tutorial section.
+    -->
+
+
+
     <!--
       Note:
@@ -148,13 +155,14 @@
 
     <!-- blue -->
+    <!--
       Mainstate:
       Apart from the standard states (like activity and visibility), each object can have a mainstate.
       You can define the mainstate with an xml-attribute: mainstate="state". "state" must be one of the
-      supported boolean states of the object. If the mainstate is set (by default that's not the case),
-      you can send events to the "mainstate" state. This allows you to hide the actually affected state
-      in the event-listener, while the event-source just sends events.
+      supported states of the object (except states which need the originator as a second argument). If
+      the mainstate is set (by default that's not the case), you can send events to the "mainstate" state.
+      This allows you to hide the actually affected state in the event-listener, while the event-source
+      just sends events.
       Note that this example is exactly like the standard case, but the event is sent to the main-state,
       which in turn is set to "visibility".
-    <!--
     -->
     <Billboard position="-200,150,0" material="Examples/Flare" colour="1.0, 1.0, 1.0" visible=0 mainstate="visibility">
@@ -184,4 +192,32 @@
     </DistanceTrigger>
 
+
+
+    <!--
+      End of the tutorial section.
+    -->
+
+
+
+    <!--
+      The following example shows again the red (standard layout) and the violet (event forwarding) example,
+      but this time with a memoryless state (spawn) from the ParticleSpawner instead of the boolean state
+      (visibility) in the other examples.
+    -->
+    <Billboard position=" 300,100,300" material="Examples/Flare" colour="1.0, 0.0, 0.0" />
+    <Billboard position="-300,100,300" material="Examples/Flare" colour="1.0, 0.0, 1.0" />
+    <ParticleSpawner position="300,150,300" source="Orxonox/BigExplosion1part1" lifetime=3.0 autostart=0>
+      <events>
+        <spawn>
+          <DistanceTrigger position="300,100,300" distance=25 target="ControllableEntity" />
+        </spawn>
+      </events>
+    </ParticleSpawner>
+    <DistanceTrigger position="-300,100,300" distance=25 target="ControllableEntity">
+      <eventlisteners>
+        <ParticleSpawner position="-300,150,300" source="Orxonox/BigExplosion1part1" lifetime=3.0 autostart=0 mainstate="spawn" />
+      </eventlisteners>
+    </DistanceTrigger>
+
   </Scene>
 </Level>
Index: code/branches/core5/src/libraries/core/BaseObject.cc
===================================================================
--- code/branches/core5/src/libraries/core/BaseObject.cc	(revision 5882)
+++ code/branches/core5/src/libraries/core/BaseObject.cc	(revision 5883)
@@ -356,5 +356,15 @@
     {
         if (this->mainStateFunctor_)
-            (*this->mainStateFunctor_)(state);
+        {
+            if (this->mainStateFunctor_->getParamCount() == 0)
+            {
+                if (state)
+                    (*this->mainStateFunctor_)();
+            }
+            else
+            {
+                (*this->mainStateFunctor_)(state);
+            }
+        }
         else
             COUT(2) << "Warning: No MainState defined in object \"" << this->getName() << "\" (" << this->getIdentifier()->getName() << ")" << std::endl;
@@ -366,13 +376,21 @@
     void BaseObject::changedMainStateName()
     {
-        this->registerEventStates();
-        
         this->mainStateFunctor_ = 0;
-        
-        std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(this->mainStateName_);
-        if (it != this->eventStates_.end() && it->second->getFunctor() && it->second->getFunctor()->getParamCount() == 1)
-            this->mainStateFunctor_ = it->second->getFunctor();
-        else
-            COUT(2) << "Warning: \"" << this->mainStateName_ << "\" is not a valid MainState." << std::endl;
+
+        if (this->mainStateName_ != "")
+        {
+            this->registerEventStates();
+            
+            std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(this->mainStateName_);
+            if (it != this->eventStates_.end() && it->second->getFunctor())
+            {
+                if (it->second->getFunctor()->getParamCount() <= 1)
+                    this->mainStateFunctor_ = it->second->getFunctor();
+                else
+                    COUT(2) << "Warning: Can't use \"" << this->mainStateName_ << "\" as MainState because it needs a second argument." << std::endl;
+            }
+            else
+                COUT(2) << "Warning: \"" << this->mainStateName_ << "\" is not a valid MainState." << std::endl;
+        }
     }
     
