otunsync problems

   3578   8   0
User Avatar
Member
176 posts
Joined: July 2005
Offline
I am trying to make an otl that has a feature to add operators within it. My problem is that I can't automate the unsyncing of the operator…it works when I do it in the textport.

this is within a callback of a button:

//adds the current selected operator and names it the same as its label
opadd $addplease $addplease;
//attempt to allow editing of contents
otunsync $addplease;

i also tryed:
otunsync -u $addplease;
otunsync -u *;
otunsync *;

I also tryed putting the path before the name…assuming it isnt finding the operator….but it all worked in the textport…I am confused.

nothing worked for me…please help!
User Avatar
Member
7714 posts
Joined: July 2005
Offline
First of all, you shouldn't use semi-colons at the end of hscript commands. Secondly, are you unsynching *before* you're trying to add? I haven't tried this but these were the first two thoughts that came into my mind.
User Avatar
Member
176 posts
Joined: July 2005
Offline
hmmmm…..so how are you supposed to seperate multiple commands without the use of a semi-colon?

also I am adding…and then unsyncing….

the main otl is already allowed to edit its contents…

I am trying to unsync otls in an “object container” inside of the main otl…

thanks Edward for your reply!
User Avatar
Member
4140 posts
Joined: July 2005
Offline
The semi-colon is supposed to indicate newline on a single line, as in:

cd /obj ; opls

What you showed, anyway, indicated a redundant use of the semicolon. A multi-line hscript script doesn't have lines ending with semicolons.

Cheers,

J.C.
John Coldrick
User Avatar
Member
176 posts
Joined: July 2005
Offline
yeah I am definetly using the semi-colon to indicate a new line…

I guess I just wasnt aware that I could leave the last line without…

thanks…..

the semi-colon unfortunetly wasn't affecting the otunsync problem when I took it out…I'm still going to add that to my future practice…

any other ideas to get otunsyc working?
Edited by - Dec. 27, 2005 13:45:37
User Avatar
Member
4256 posts
Joined: July 2005
Offline
JColdrick
The semi-colon is supposed to indicate newline on a single line, as in:

cd /obj ; opls

The key word here is “supposed”

:?

Every month or so I get smacked by this because I forget that the following doesn't work.
for i=0 to 10 ; echo $i ; end ;

One of these days I'll remember….
Edited by - Dec. 27, 2005 13:55:48
if(coffees<2,round(float),float)
User Avatar
Member
4256 posts
Joined: July 2005
Offline
lynch_ppl
I am trying to make an otl that has a feature to add operators within it. My problem is that I can't automate the unsyncing of the operator…it works when I do it in the textport.

Careful what your current network is. (oppwd)

If you callback script is on /obj/model then the script is basically doing this before its run opcf /obj/model

So if you are trying to unsync something in /obj then you'll need to do a
opcf ..
first or just
otunsync ../*

Best way to find out where the hell you are at, is to do
message `oppwd()`

When ever I'm doing callbacks I have these things everywhere to make sure the script is executing in the correct place.


So if you have a button on a digital asset that adds nodes to the asset then you'd need something like this

otunsync .
opadd geo myTurnip
if(coffees<2,round(float),float)
User Avatar
Member
176 posts
Joined: July 2005
Offline
thank you so much…

I never thought about error checking like that…

I finally got it to work after a couple more tries…

I feel so much better now!

final code if anyone is interested:
set addplease = `chs(oppwf() + “/add_op”)`; opcd `oppwf()`/object_container/; opadd $addplease $addplease; opcf `oppwd()`; message `oppwd()`; otunsync `oppwd()`/$addplease*
User Avatar
Member
4256 posts
Joined: July 2005
Offline
One of the things that will save you headaches down the road is to Embed your script into your digital asset then source.

So instead of your callback script being some endlessly long line, you would just have source opdef.?myScriptName.cmd

To add a script to a asset, right click on your asset and bring up the Operator Type Manager.

Then right click on it and pick “Edit Contents”

Under Section Name put the name of you script (myScriptName.cmd)
Then click Add Empty Section.

Now you can edit your script there. (Just remember to click apply to update your script.)
if(coffees<2,round(float),float)
  • Quick Links