Author Topic: Move actor off-screen?  (Read 11556 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Move actor off-screen?
« 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).

Code: [Select]
   (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?


In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Doan Sephim

Re: Move actor off-screen?
« Reply #1 on: August 07, 2013, 07:37:17 PM »
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, but that only works on the y axis...

Offline gumby

Re: Move actor off-screen?
« Reply #2 on: August 08, 2013, 08:37:26 AM »
I'm pretty sure it's possible.  I remember messing around with avoid script and having the ego disappearing off screen.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Move actor off-screen?
« Reply #3 on: August 09, 2013, 05:50:30 PM »
I just did some testing and it looks like an actor will go offscreen until the origin/hotspot for the view is hit.
« Last Edit: August 09, 2013, 05:53:40 PM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Move actor off-screen?
« Reply #4 on: August 09, 2013, 10:50:21 PM »
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.
« Last Edit: August 09, 2013, 11:02:48 PM by Collector »
KQII Remake Pic

Offline gumby

Re: Move actor off-screen?
« Reply #5 on: August 10, 2013, 11:29:54 AM »
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.
« Last Edit: August 10, 2013, 03:12:46 PM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: Move actor off-screen?
« Reply #6 on: August 17, 2013, 03:38:32 PM »
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.
Brass Lantern Prop Competition

Offline Cloudee1

Re: Move actor off-screen?
« Reply #7 on: October 22, 2013, 01:06:25 PM »
In the Feature script, scroll down to the canBeHere method of the Act class.

Code: [Select]
(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.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: Move actor off-screen?
« Reply #8 on: October 22, 2013, 04:36:23 PM »
Thank you!!
Brass Lantern Prop Competition

Offline Cloudee1

Re: Move actor off-screen?
« Reply #9 on: November 02, 2013, 09:34:57 PM »
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.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Collector

Re: Move actor off-screen?
« Reply #10 on: November 03, 2013, 01:12:46 AM »
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.
KQII Remake Pic

Offline Cloudee1

Re: Move actor off-screen?
« Reply #11 on: November 03, 2013, 01:42:38 AM »
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.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Move actor off-screen?
« Reply #12 on: November 03, 2013, 08:50:06 AM »
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
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: Move actor off-screen?
« Reply #13 on: November 12, 2013, 04:23:48 PM »
Yes.
Brass Lantern Prop Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.078 seconds with 22 queries.