Development Forum |
|
Some trouble with C2 CAOS | |
|
Dranorter
|
3/12/2011 | |
Hi all!
Since CAOS has access to most of the menu items in the game, I had the idea of recoding the whole interface as a sleeker set of in-game objects, in order to free up screen space. My first try was a Norn head (which floats around and is invisible to Norns) whose eyes close or open when the object is clicked; when the eyes are open, it switches which Norn is selected every 400 ticks. (I saw a COB similar to this a while ago but could not find it.)
The head works just fine except for one detail, which I'm asking for help on. Right now I have the object sitting in the air in the nursery room, because I could not get it to follow the screen around. There's a behaviour flag which should set it to follow the screen, which works just fine except when the view suddenly jumps to another creature halfway across the world-- then the object is left behind and gets lost.
Obviously always staying in view is an important feature for an alternative game interface (though sometimes I would turn it off, leaving the unnecessary interface elements somewhere out of the way). But how can I write manual jump code, to move them when the focus creature is switched? I tried a few things and got nothing but errors, so those scripts are gone and I can't even offer them as an idea of what fails.
Anyone know how to get the floating to work properly? |
AquaShee
|
3/13/2011 | |
Hmm, since the object makes the view jump around, perhaps add some code to reposition the object after this bit in the timer script?
Which commands are you using, exactly?
The Community Scribble: make (y)our own metaroom! |
Dranorter
|
3/13/2011 | |
Basically what I tried was storing relx and rely after 'targ hand' and then switching to the next norn. I was getting errors in this even without finishing the job and moving the object. I'll try it again so I can give you the exact code...
scrp 2 16 41101 9
targ hand
setv var1 relx
setv var2 rely
targ ownr
sys: cmnd 32989
targ hand
subv var1 relx
subv var2 rely
targ ownr
mvby var1 var2
tick 400
endm |
Dranorter
|
3/13/2011 | |
Oh man I knew I would embarrass myself if I posted the code! Should be PNTR not HAND. That takes care of the error, but the object still does not move...
Edit:
You may also have noticed the sign error, which I noticed but which I figured wouldn't keep the thing from moving... figured incorrectly. Making var1 and var2 negative before the mvby command makes it work ... *some* of the time... I can't figure out what's making the difference between working and not, looks like maybe it works when it's switching a long distance like to the volcano from the hatchery.
That combined with the fact that this solution won't work when the view jumps for other (ie user-initiated) reasons makes me think I should just try something else.
Edit 2:
Now have things mostly working via a different scheme: grab camera position every 5 ticks and move the object to the right place on the screen based on that. The only problem is with repositioning the object. I figured I'd kill the repositioning script whenever the hand picks up the object, and 'reboot' it with new coordinates whenever the object is put down... however the drop event (5) appears never to trigger, or something... maybe I'll just give up on the repositioning element. |
|