Template Game Bug Fixes: Difference between revisions

From Sierra Wiki
Jump to navigationJump to search
Andrew Branscom (talk | contribs)
No edit summary
Andrew Branscom (talk | contribs)
No edit summary
Line 1: Line 1:
[[Category:SCI Pages]]
[[Category:SCI Pages]]
[[Category:Temp SCI Import Pages]]
[[Category:Temp SCI Import Pages]]
[[Category:Temp SCI Tutorials]]
[[Category:SCI Pages to be Edited]]
[[SCI Tutorials]]
[[SCI Tutorials and Guides]]
 


<div align="center"><span style="font-size: 22pt">Template Game Bug Fixes</span><br /></div>
<div align="center"><span style="font-size: 22pt">Template Game Bug Fixes</span><br /></div>
Line 65: Line 62:
and you're all set.
and you're all set.


==<br /> References ==
<references />
==<br /> Related Links ==
* &nbsp;
&nbsp;
&nbsp;
[[Category:Template Games]]
[[Category:Template Games]]
[[Category:SCI Template Games]]
[[Category:SCI Template Games]]

Revision as of 18:31, 30 April 2025


Template Game Bug Fixes



Setting Inventory views to any cel, loop, or view

While trying to set the inventory items instance found in the main script, you will find that no matter how you set the loop or cel, only loop 0 and cel 0 is shown.

To fix this bug, simply change a couple of the default variable values found in the Iitem of InvI class found about halfway down the main script. In the showself method, the default inventory icon variables manually set the cel and loop to 0, just like it's doing. If you would like to be able to set these variables via the instance of the item located at the bottom of the main script, we simply need to change the zeros to loop and cel respectively.

In main.sc

Code:
/******************************************************************************/
(class Iitem of InvI
    (properties
        said 0
        description 0
        owner 0
        view 0
        loop 0
        cel 0
        script 0
    )
    (method (showSelf)
        Print(
            description
            #title objectName
            #icon view loop cel // Changed from: #icon view 0 0
        )
    )
)
/******************************************************************************/

A small typo in the doit method of timer class

This is actually a small snippet from Lars' post on how to use timers. Just in case your looking for a bug free template and you happened to overlook that post I'd thought that I'd copy it to here as well.


There's the setReal method. Like set, it performs all calculations on its own, but it uses the seconds counter, and it does not adjust for game speed. Thus, it is ideal for game events that depend on how much "real time" passes. However, it does not work out of the box due to a typo in the template game. To fix it, find the doit method of the timer class (in Timer.sc), and the line that says:

Code:
(if (not seconds)
    CueClient()
)

Fix the first line so it reads:

Code:
(if (not --seconds)

and you're all set.


References



Related Links

  •