OSA Default Script Processor not working

Ask and answer questions related to any type of OSA scripting.
Post Reply
Message
Author
Andre
Posts: 26
Joined: Tue Jul 08, 2014 6:29 am

OSA Default Script Processor not working

#1 Post by Andre » Tue Jul 08, 2014 7:02 am

Hi, I am a noob at OSA, I have just started playing, but things are working and the learning curve is progressing smoothly.

However, I am struggling to get "OSA Default Script Processor" to work. They appear to execute, but I am not seeing any changes. I have two simple lines in a script that I am kicking off via a Scheduler. (Set to run every 5 minutes)

The Simple Script (AndreStateHere) is as follows:-
Andre.Set State.Here
Playroom.Set State.Vacant

"Andre" is a PERSON object and "Playroom" is a PLACE Object.

When the schedule runs, I get

07/08/2014 04:35:17.813 PM - Found Script: AndreStateHere
07/08/2014 04:35:17.823 PM - 1: (0) - Set State: Andre.
07/08/2014 04:35:17.828 PM - 2: (0) - Set State: Playroom.
07/08/2014 04:35:17.833 PM - Executed Script

But nothing happens and the States of these objects do not change. (Gone and Occupied respectively)
I have also tried the states are simply On or Off.
Am I misunderstanding something about the scripting engine?
Setting OSA to debug mode doesn't seem to give me any more detail in the script.

Regards

Andre

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: OSA Default Script Processor not working

#2 Post by Vaughn » Tue Jul 08, 2014 7:24 am

You seem to have a decent grasp of it. What you are doing should work, I will try to validate that Set State is working, I seldom use it.

However, I think you may want to execute the Methods on those objects, as setting a State directly will not trigger scripts, etc.

Andre.Run Method.Here
Playroom.Run Method.Vacant


Vaughn

Andre
Posts: 26
Joined: Tue Jul 08, 2014 6:29 am

Re: OSA Default Script Processor not working

#3 Post by Andre » Tue Jul 08, 2014 10:13 pm

Thanks Vaughn, It does indeed work with the methods.

And the methods change the state correctly.

For clarity if this is an issue for anyone else, the specific Methods are

[PERSON].Run Method.Leaving (or Arriving)
[PLACE].Run Method.Vacate (or Occupy)

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: OSA Default Script Processor not working

#4 Post by Vaughn » Wed Jul 09, 2014 11:15 am

I took a few minutes to look at the code for Set State this morning and it all looked good and simple, but I was about an hour late to work and did not have a chance to actually make some test scripts.

I will still do some tests and make sure the Set State is working though. It may even be depricated in the future though. but glad you got things moving forward.


Vaughn

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: OSA Default Script Processor not working

#5 Post by Vaughn » Wed Jul 09, 2014 4:09 pm

Hah, I take most everything back, although that was my original intentions for Set State, I just tested it, and not only does Set State work, but it was firing the events and triggering scripts to run and everything.

I tested with Vaughn.Set State.ON and OFF, and also Vaughn.Set State.Here and Gone. All of them seem to work fine.

Now, I am running from source, so there very well could still be an issue in 043. Just another reason we have to get version 044 out. If our other resources are not able to help release in the next few weeks, I think I can do it all myself. I already looked at the packaging code, and I think I can do the DB Diff and default data changes ok. I am not able to test any builds right now though since both of my laptops died, I am down to a single desktop.

BTW, 044 has some script editor fixes in it and also has a test button now so you can run your scripts easily with parameters from the script page. That should make working on them a bit easier.


Vaughn

Vaughn
Site Admin
Posts: 1432
Joined: Thu May 13, 2010 2:17 pm

Re: OSA Default Script Processor not working

#6 Post by Vaughn » Wed Jul 09, 2014 4:36 pm

Andre, I assume you have this set right since the methods work, but on the PEOPLE and PLACE object types, they need to have their OWNER set to SYSTEM.

Basically, any Object Type that is not being handled by a plugin needs to be owned by SYSTEM so the DB knows to handle everything.

Vaughn

Andre
Posts: 26
Joined: Tue Jul 08, 2014 6:29 am

Re: OSA Default Script Processor not working

#7 Post by Andre » Wed Jul 09, 2014 10:28 pm

I have double checked and they are definitely both owned by SYSTEM.
I will have another go this weekend, but the Methods are what I will really be using, I was just trying to start with something simple first :D

I am going to try out the Powershell scripting as well. Thanks for you help

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: OSA Default Script Processor not working

#8 Post by Automate » Thu Jul 10, 2014 6:21 am

Andre wrote:But nothing happens and the States of these objects do not change. (Gone and Occupied respectively)
Did you make sure you refreshed the OSA Objects page? The page will NOT update on it own when a state changes.

Andre
Posts: 26
Joined: Tue Jul 08, 2014 6:29 am

Re: OSA Default Script Processor not working

#9 Post by Andre » Fri Jul 11, 2014 10:38 pm

@Automate - Oh Man did I Cntrl-F5 the hell out of that page. :lol:

The State_Id of the Andre object in the osae_object table also doesn't change from 4 to 3 like I am expecting it to.

But my method scripts still run fine and set the State accordingly so that works perfectly for me.

I think that its just my machine.. I'll give it another go on 0.4.4 when it gets released.

Post Reply