Community

SCI Programming => SCI Syntax Help => Topic started by: Doan Sephim on December 03, 2021, 09:26:44 PM

Title: xStep, yStep and the edge of the screen
Post by: Doan Sephim on December 03, 2021, 09:26:44 PM
I'm having an issue with actors moving at certain x or y steps not hitting edge of screens or triggering thin control lines.

Most of this I can work around without too much difficulty, but my character running speed is xStep 5 and the fact that the character isn't triggering the edge of screen room change is becoming a problem.

Has anyone else had this issue and/or know an easy solution?

I am a little confused on how I didn't have this issue with Betrayed Alliance Book 1, which uses the same character sprite and xStep running speed.  :o
Title: Re: xStep, yStep and the edge of the screen
Post by: MusicallyInspired on December 04, 2021, 09:33:23 AM
Is the issue with keyboard controls or mouse controls? I have control issues like that all the time with one of them and I have to use the other to actually trigger the boundary and trigger the next screen with KQ2SCI and I've never solved. Not without control colours to trigger it instead anyway.
Title: Re: xStep, yStep and the edge of the screen
Post by: Doan Sephim on December 04, 2021, 12:08:04 PM
Is the issue with keyboard controls or mouse controls?
Keyboard controls
Title: Re: xStep, yStep and the edge of the screen
Post by: doomlazer on December 04, 2021, 12:33:47 PM
You might check how 'edgehit' gets set in the ego class doit method defined in User.sc.

In the SCI01 template, it checks if the ego position is equal to or greater/less than the defined screen edge, so it should always get triggered even if your ego is John Coltrane and taking giant steps off screen.

Code: [Select]
(= edgeHit
(cond
((<= x westEdge)
WEST
)
((>= x eastEdge)
EAST
)
((>= y southEdge)
SOUTH
)
((<= y (curRoom horizon?))
NORTH
)
(else
0
)
)
)

When edgehit is non zero, the room class doit method in Game.sc should change the room based on the edgehit property. At least that's the case in the template.



Edit: Does your running view trigger the new room as expected if the xStep isn't changed?
Title: Re: xStep, yStep and the edge of the screen
Post by: Doan Sephim on December 04, 2021, 08:13:20 PM
I'll have to look into that code when I get a chance. I haven't checked other xStep numbers with the running animation yet, but I have tested it with other views. Sometimes it works and sometimes not.

Also, the running animation will work if I set the posn to a particular location, which might've been enough to fix the problem, but sometimes it will change if I run into a white control line at some point in the background, then it throws things off