Author Topic: xStep, yStep and the edge of the screen  (Read 816 times)

0 Members and 1 Guest are viewing this topic.

Offline Doan Sephim

xStep, yStep and the edge of the screen
« 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


Artificial Intelligence Competition

Offline MusicallyInspired

Re: xStep, yStep and the edge of the screen
« Reply #1 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.
« Last Edit: December 04, 2021, 09:35:29 AM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Doan Sephim

Re: xStep, yStep and the edge of the screen
« Reply #2 on: December 04, 2021, 12:08:04 PM »
Is the issue with keyboard controls or mouse controls?
Keyboard controls

Offline doomlazer

Re: xStep, yStep and the edge of the screen
« Reply #3 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?
« Last Edit: December 04, 2021, 06:58:57 PM by doomlazer »

Offline Doan Sephim

Re: xStep, yStep and the edge of the screen
« Reply #4 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


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

Page created in 0.091 seconds with 24 queries.