Community
SCI Programming => SCI Syntax Help => Topic started by: gumby on August 07, 2013, 06:57:07 PM
-
I'm trying to move an actor offscreen: just have the actor move 'down' the Y axis (y = 1000).
(myActor:setMotion(MoveTo 90 1000))
...but when the bottom of the view hits the edge of the screen, the view stops. Is there some property that I missed specifying for the actor or something?
-
I just ran into this problem today also...and I also don't know the solution.
I mean, we could probably use the z-coordinate (http://sciprogramming.com/tutorial/tchapter6.html), but that only works on the y axis...
-
I'm pretty sure it's possible. I remember messing around with avoid script and having the ego disappearing off screen.
-
I just did some testing and it looks like an actor will go offscreen until the origin/hotspot for the view is hit.
-
A few SCI games have 2 screens wide pics to allow scrolling from one room to the next. This may only apply to the x axis. It might also not be possible with the interpreter version of the template game or with the editors in Studio or companion. If you had the pic taller than the room, you could move the character into the part of the pic not seen.
Other than that, can a view change the hotspot in another loop? You could add one row of transparent pixels at the top and place the hotspot on that top row.
-
Great idea. My current view only has a single cell, but I could create 4 different identical cells that would each correspond to the direction that the view is moving in. I'll have to add a transparent border all the way around the view, and then I can place the hotspot in the opposing compass position border based on the direction.
So when the view is moving 'north', I just switch to the cell that has the hotspot in the 'south' position of the view. When the view is moving 'east', switch to the cell that has the hotspot in the 'west' position. And so on. This will allow the entire view to move off screen until it hits the hotspot in the transparent border, at which point the visible portions are completely hidden off screen.
This will work perfectly, thank you.
EDIT: Well, it sort of works. The problem is that hotspot corresponds to where the view is placed on screen, so when the hotspot changes, the view 'jumps'. Probably could get around this by changing the current coordinates of the view so the hotspots line up & the animation is seamless.
-
I had this problem when scripting the Intro for KQ2SCI. I think I just ended up making an entirely new View resource with the hotspot in a different location so he could walk offscreen to the left smoothly. I never found another workaround. I'd really like to know how Sierra did it.
-
In the Feature script, scroll down to the canBeHere method of the Act class.
(method (canBeHere)
(if(baseSetter)
(send baseSetter:doit(self))
)(else
BaseSetter(self)
)
(if((== illegalBits 0) and (& signal $2000)
or CanBeHere(self (send gCast:elements)) )
(if( (& signal $2000) or (not IsObject(gRoom))
or (>= y (send gRoom:horizon)) )
(if((== blocks 0) or (send blocks:allTrue(#doit self)))
// (if(>= x 0 and <= x 320 and >= y 0 and <= y 190)
return(TRUE)
// )
)
)
)
return(FALSE)
)
Now, Comment out the (if >= x 0 ... line as well as the ) that closes it like I did in the code above. However, make sure to leave the return(TRUE) in there uncommented. The actors now should not have any problems traveling off and onto the screen.
-
Thank you!!
-
Anyone else think that this should be added to the template game? I am itching to update a couple of typos in the point and click template, as well as add a couple of sound drivers to the zip folders but I would hate to make an update for such trivial issues. Changing some of the code however, now that would warrant a version update. Personally too, I have tried to get my actors off screen more often than I have been thankful that they were bound by the edges.
-
Sure. Not every exit to the next room will be a door or some other thing that would be done by another method and animation.
-
I haven't tested it, but I do not think that this would work with the ego. For some reason I have it in my head that there is some edgeHit variable somewhere that actually determines when the ego hits the edge and launches the room change then. This would really only apply to non playable characters.
-
I'd say go for it & update the template. Maybe to preserve the current functionality it could be enabled/disabled with a flag in the Main.sc?
I would also vote for adding in my code into the template as well from the post here: http://sciprogramming.com/community/index.php/topic,37.msg3919.html#msg3919
-
Yes.