TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Page 1 of 3 123 LastLast
Results 1 to 25 of 67

Thread: New Scripts: tnhScript 2.1 [final] Public Scripts 2.1 [second test]

  1. #1
    Member
    Registered: Aug 2001
    Location: Virginia, USA

    New Scripts: tnhScript 2.1 [final] Public Scripts 2.1 [second test]

    tnhScript 2.1
    Final "It's About Taffin' Time" Release
    http://whoopdedo.org/projects.php?scripts#tnhScript
    Mirror:http://thiefmissions.com/telliamed/tnhscript21.zip
    Demo: http://whoopdedo.org/projects.php?fm#tnhdemo
    Mirrors will be linked as they become available.

    tnhScript 2.1 is ready for use in new and old fan-missions. All in-progress FMs should upgrade now. Existing FMs that included the OSM in the archive may want to consider upgrading.

    Full documentation for the scripts is hosted on The Dromesday Book. Editors, of course, can rewrite the descriptions to be more helpful. But I'm also allowing open-submission of comments on each page. So you can add extra messages such as tips and recipes for how to use the scripts. You don't need to be logged in to add comments. Bug reports and feature requests should be sent to me here on the forum, or by email.

    Public Scripts 2.1
    pre-release
    http://whoopdedo.org/projects.php?scripts#PublicScripts

    Second test has been uploaded. The demo COW has been built for Thief 1 as well. I remembered the books this time. If nothing comes up in the next two weeks, I'll make an official release of it. Please everyone try out the COW at least once. Bonus cookies if you can manage to break something. (Have fun with the Hammerite at the end.)

    Documentation at the wiki as always.
    Last edited by Telliamed; 23rd May 2009 at 16:45. Reason: final + pubscripts

  2. #2
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    As a Dromeder who's always implementing things I'd like to say thanks for your efforts
    No slow gas arrows hitting banners in my missions.

    PoliteVOTrap: Is it intentional that the VO won't play if there was an AIInvest link which has since been removed (e.g. the investigating AI was snuffed out)?

    I'll look at the others tomorrow.

  3. #3
    Member
    Registered: Mar 2001
    Location: Ireland
    Most excellent.

    (Though I've got to the dangerous point where I'll generally sooner write my own script than find out how to use someone else's...)

  4. #4
    Member
    Registered: Aug 2001
    Location: Virginia, USA
    Demo mission uploaded.

    Isn't Dark supposed to kill the AIInvest links when the mode changes to "dead"? Or that could just be AIAwareness. I'll see what I can do.

    Found a nasty bug that affects OnScreenText. Don't press the button on the south wall of the tiled-ceiling room!

    For NV: IProperty::GetSimple sometimes gives a NULL string property even when IsSimplyRelevant was true. Always check your pointers. (GetObjectParamsNoInherit)

  5. #5
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Fields of bluegrass
    This is wonderful, Tom. What made you decide to go back to working on it?

    I'll try it out tonight, I've had zero Dromed time all week but tonight is looking good. I assume you've fixed the crash in OnScreenText in Win9x and 2k?

  6. #6
    Member
    Registered: Aug 2001
    Location: Virginia, USA
    This is wonderful, Tom. What made you decide to go back to working on it?
    That tnh1.5 was utter crap that no one should ever be allowed to pollute their hard drive with.

    I never really stopped. cosas2.osm is basically tnh2 with the extra conversation mask stuff.

    I'll try it out tonight, I've had zero Dromed time all week but tonight is looking good. I assume you've fixed the crash in OnScreenText in Win9x and 2k?
    What you're thinking of, most likely. It now crashes for a completely different reason. (see above)

    Fun thing you can do with TrapFreezePlayer thanks to the new arcontrol receptron interface. I call it the "time dilation field". You have the trap emit a "GravityStim" over the affected area from 0.0-1.0. The Player responds by sending back a "PlayerPingStim" after multiplying by -1. So the trap gets a PlayerPingStim of 0 when the player is at the outer edge of the field, and -1 at the center. The trap has stacked receptrons for PlayerPingStim. The final result is to send the stim to the script, which has arcontrol=PlayerPingStim in the design note. But first you multiply+add the receptron. The multiplier can be whatever you want for scaling, then add 1.0 so the script gets 1.0 at the edge of the field and 0.0 at the center. And so the player moves increasingly slower the closer he gets to the trap.

    Want to be really evil? Make it so the speed gets slower as you move away from the trap.

    Also, what do you think happens when the speed goes below zero?

    One last thing. You should stick a bounds trigger where the player leaves the area that sends "TurnOff" to the trap so all that mucking-about with speed is reset.
    Last edited by Telliamed; 5th Mar 2009 at 19:30.

  7. #7
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Fields of bluegrass
    Oh my god, that sounds deliciously evil.

  8. #8
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    I noticed TrapFadeOut now expects the design note to be in a different format. Would it be possible to provide backwards compatibility so that existing FMs using the previous version can still have their fade out effects?

  9. #9
    Member
    Registered: Aug 2001
    Location: Virginia, USA
    What was it before? Do you mean this...
    Quote Originally Posted by tnhScript 1.5.4 Documentation
    When the script is turned on, it first looks for the parameter ''on''. If it doesn't exist then GenericScale will consider the whole parameter.
    ...
    Using an entire design note as the parameter for a generic script will be removed in tnhScript 2. Please only use explicit ''on'' and ''off'' parameters.
    You were warned.

    For finding objects with scripts there's ''hilight_by_prop_direct Scripts'' (And next time create archetypes for traps you use a lot.)

    Or if you have Python...
    Code:
    import sys
    from struct import unpack
    from StringIO import StringIO
    from DarkDB import DarkDB
    
    def ns(s):
        n = nm.find('\0')
        if n != -1:
            s = s[:n]
        return s
    
    db = DarkDB(file(sys.argv[1], 'rb'))
    prop = StringIO(db['P$Scripts'])
    while prop.tell() < prop.len:
        (objid,proplen) = unpack('2l', prop.read(8))
        scripts = unpack('32s32s32s32s4x', prop.read(132))
        for s in map(nm,scripts):
            if s.lower() == 'trapfadeout':
                print objid
    Other than that, I try to avoid doing anything that would break existing missions.

  10. #10
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    In an ideal world everyone would read all instructions and ensure they understood them. However...

    Interestingly I just had a look at how I used TrapFadeOut in All Torc, and found that I'd used on="some number". I must have asked you how to use it, because I can't see how I would have made the connection between that quoted text and the description for using that specific script.

  11. #11
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    It seems that OnScreenText will crash if there is no design note. It can be empty, but it must be there.

    I've also encountered something strange. In my FM I have a couple of convs for which OnScreen text is being used to display subtitles. As each line is said, the actor frobs an object.

    To save objects, I combined NVRelayTrap and OnScreenText, so that the former sent TurnOn to itself each time it was frobbed. With the previous version of tnhScript this worked as expected: each frob would show the correct page. With the current version it would only show the first page. I fixed it by separating OnScreenText and NVRelayTrap, so that two objects are now used. I just thought I'd mention this in case it turns out to be connected to something more significant.
    Last edited by R Soul; 6th Mar 2009 at 20:41.

  12. #12
    Member
    Registered: Aug 2001
    Location: Virginia, USA
    Quote Originally Posted by R Soul View Post
    It seems that OnScreenText will crash if there is no design note. It can be empty, but it must be there.
    Quote Originally Posted by me
    Found a nasty bug that affects OnScreenText.
    I can't do any testing for a week. I'll have to look at the deal with NVRelay when I get back. If this is a developing mission, I have my own Frob->TurnOn trap that's a bit simpler than that. Or you should be able to do something with ScriptControl instead of frobbing.

  13. #13
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    I've read the instructions several times but I still haven't a clue how to use ScriptController.

    I want to have a conversation AI to send TurnOn to a trap (let's pretend I haven't just remembered NVConvEnhancer). So you're saying I can use ScriptController to send the TurnOn message? This is where I'm stuck.

    I have a conv action which is ScriptMessage: TurnOn
    The AI has the script ScriptController, and design note on="TurnOn", and a CD link to a trap (OnScreenText). The trap is receiving the ScriptControl message, but I don't know how to configure it to respond to it.

    I thought I could put on="ScriptControl" in the design note, but it still wouldn't activate it.

  14. #14
    Member
    Registered: Aug 2001
    Location: Virginia, USA
    You've got it backwards. ScriptControl is an alternative to TurnOn. The on parameter tells the script what to do when the trap is turned on. ScriptControl activates the script directly. A TurnOn with ''on=3'' is the same as sending ScriptControl with the message argument ''3''.

    To control OnScreenText you put ScriptController on the AI. Instead of the frob action do a script message action. Message name (argument 1) is ''ScriptControl''. Message data (argument 2) is ''#1'' to display page 1. Other message data (argument 3) is the OnScreenText trap name or object ID.

    NVRelay can be translate the ScriptControl for traps that only understand TurnOn. (But then, you can use any message you want, like "JustWorkDammit".)

    When you get the hang of it, it would be nice to fix up the wiki so it's more understandable. I also need to add a page to explain inheritance. It's second-nature to a programmer, but you mere mortals seem to have trouble with it. (Short lesson: See that box that says "Inherits: ..."? Click it.)

  15. #15
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    I think I understand the principle.

    The ScriptControl message can be sent to allow greater control over how the target object responds, if the target object uses something from tnhScript.

    The message can be sent from conv, thus:
    Action: ScriptMessage
    Argument 1: ScriptControl
    Argument 2: message data - depends on the target object
    Argument 3: name/ID of target object

    If argument 3 is empty, the message will be sent along outgoing ControlDevice links.

    The conversation actor must have the script ScriptController.


    To have it sent from an ordinary object, give it the ScriptController script, and use the design note to specify the argument:
    on="message data"

    I know I can then make a CD link to the target object, but out of curiosity, could another design note parameter be used to set the target object?

    Which other scripts can respond to ScriptControl?

  16. #16
    Member
    Registered: Aug 2001
    Location: Virginia, USA
    Would a target parameter be that more useful than a CD link?
    (Yes, so you could type "^guard" or whatever ... I'll think about it but may decline. And it's not going to be in this release in any case.)

    Remember also that you can put the target script directly on the AI instead of using ScriptController. But there are often side-effects (AI become frobbable when dead, etc.).

  17. #17
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    Quote Originally Posted by Telliamed View Post
    Would a target parameter be that more useful than a CD link?
    Probably not, I was just curious.

  18. #18
    Member
    Registered: Aug 2001
    Location: Virginia, USA
    I've uploaded a new version that, as far as I know, works perfectly.

    And the issue with OnScreenText, I was being really dumb about. Forget what I said earlier, NV. I forgot the "!" in if (!pProp->IsSimplyRelevant(iObj)) so of course it wasn't working. Check your copy of the source for that.

  19. #19
    Member
    Registered: Mar 2001
    Location: Ireland
    Right, that makes sense. And it looks like I just put in the version you sent me, so I'd gained that bug, too. Fixed.

  20. #20
    Member
    Registered: May 2006
    Location: Russia
    New version seems work fine under Windows 98! I had problems with ver 1.5.4 - DromEd crashed after exiting game mode. Now everything is OK.
    (I'm working under XP, but have Win98 and DromEd on another machine.)
    How do you think, will it be wise to drop Tnhscript 1.5.4 from the mission I'm building and load new module version instead?

  21. #21
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Fields of bluegrass
    I need to find time to play with this, especially the new and improved OnScreenText. I am going to use it to display translated subtitles for the conversations in DCE and want one book file per conversation instead of per line. I know some folks (R Soul) are proficient at that, does anyone have a tut on best practices for changing pages etc. using this script?

  22. #22
    Member
    Registered: Jan 2001
    Location: Formby, NW England
    When a line is played from a conv, use the Script Message action to send a ScriptControl message to the actor:

    I edited the ScriptController page to explain how to generate the message:
    http://whoopdedo.org/doku/tnhscript/scriptcontroller

    To work out suitable vales for MsgData1, you have to read the ScriptControl section of the OnScreenText page:
    http://whoopdedo.org/doku/tnhscript/onscreentext

  23. #23
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Fields of bluegrass
    Thanks for the info and tuts. With over 250 spoken lines, I'm going to need all the help I can to make it simple to implement subtitles.

  24. #24
    Member
    Registered: May 2006
    Location: Russia
    I made the conversation using Tnhscript ver 1.5.4: one text file with new page for each phrase, and combined 'book' with button linked via ControlDevice to itself. (Scripts are: TrigWorldFrob, OnScreenText.) Works fine: each frob of a button reads the next page of text file.
    Later I realized that new pre-version of scripts released and it had problems with this way of using OnScreenText (combined with button). I was curious, downloaded the latest (!!!) version of Tnhscript, loaded mission, dropped Tnhscript and loaded another module instead (I named it Tnhscript2). And checked conversation.
    Everything worked fine!

  25. #25
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Fields of bluegrass
    Very clever, Zontik. I'll probably do something similar and have the conversation actors frob their book object just before speaking each line.

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •