Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 53

Thread: sonic sword script need help

  1. #21

    Default

    first run through..... Creates weapon of choice.
    Second test.... I lay down to see if script killer(?) worked. entering command ;k ssword did evoke the proper response.
    First issue, I tried to restart the script again right after killing it and got this:
    ;ssword longsword pooka miner
    --- Lich: ssword active.
    [ssword]>tell weapon to return
    You don't even have one!
    >
    [ssword]>tell weapon to return
    You don't even have one!

    The one thing I noticed was that I had just a few moments ago dismissed the sword. Even though it wasn't in the room Uberspells showed a few minutes left on the song. Did a kill again and got the message the script wasn't running, ran a few checks:
    >;list
    --- Lich: narost, dreavening, uberbounty
    >;listall
    --- Lich: narost, dreavening, uberbounty, infomon, lnet, keepalive, uberbar, uberspells, sexual-favors, inspectweight, group_ajar, sorter
    >spell active
    You currently have the following active spells:
    No spells found.
    But was still showing up on uberspells. Waited for the counter to go away and tried again and script ran properly.

    I don't know if you get knocked down and laying down are the same thing....I also ran the script and standing drank some death rum (which stuns you and you fall over). I was never pulled to a standing position.

    I ran a quick test to see if it performed correctly in the field and saw a strange exchange:

    [go2]>west
    [Lower Dragonsclaw, Forest]
    The underbrush is quite thick here near the forest's edge, forcing you to slow your steps as you maneuver through the trees. You also see a rolton, a vine-covered arch and a briar patch.
    Obvious paths: north, east, southwest, west
    Your animated longsword followed.
    >
    [go2]>southwest
    [ssword]>tell weapon to return

    Should there be an "end" at the end of this line? fput "tell weapon to return" if Spell[1025].active? && !GameObj.npcs.find{ |i| i.name =~ /#{script.vars[1]}/}

  2. #22

    Default

    first run through..... Creates weapon of choice.
    Second test.... I lay down to see if script killer(?) worked. entering command ;k ssword did evoke the proper response.
    First issue, I tried to restart the script again right after killing it and got this:
    ;ssword longsword pooka miner
    --- Lich: ssword active.
    [ssword]>tell weapon to return
    You don't even have one!
    >
    [ssword]>tell weapon to return
    You don't even have one!

    The one thing I noticed was that I had just a few moments ago dismissed the sword. Even though it wasn't in the room Uberspells showed a few minutes left on the song. Did a kill again and got the message the script wasn't running, ran a few checks:
    >;list
    --- Lich: narost, dreavening, uberbounty
    >;listall
    --- Lich: narost, dreavening, uberbounty, infomon, lnet, keepalive, uberbar, uberspells, sexual-favors, inspectweight, group_ajar, sorter
    >spell active
    You currently have the following active spells:
    No spells found.
    But was still showing up on uberspells. Waited for the counter to go away and tried again and script ran properly.

    I don't know if you get knocked down and laying down are the same thing....I also ran the script and standing drank some death rum (which stuns you and you fall over). I was never pulled to a standing position.

    I ran a quick test to see if it performed correctly in the field and saw a strange exchange:

    [go2]>west
    [Lower Dragonsclaw, Forest]
    The underbrush is quite thick here near the forest's edge, forcing you to slow your steps as you maneuver through the trees. You also see a rolton, a vine-covered arch and a briar patch.
    Obvious paths: north, east, southwest, west
    Your animated longsword followed.
    >
    [go2]>southwest
    [ssword]>tell weapon to return

    Should there be an "end" at the end of this line? fput "tell weapon to return" if Spell[1025].active? && !GameObj.npcs.find{ |i| i.name =~ /#{script.vars[1]}/}

    With the test of restarting the script right after killing it, I started and stopped the script that I used earlier today and under the same conditions started the script. It did the same thing as the complete script. I also saw the following:
    Also here: Averlee
    Obvious exits: none
    Your animated longsword followed.
    >
    [ssword]>tell weapon to return
    Your animated longsword bobs in the air next to you.

    I didn't get the message that the sword was ceasing attacking anything. Perhaps it has to attack something first...
    Last edited by Eliseen; 01-02-2021 at 08:40 PM.

  3. #23

    Default

    Quote Originally Posted by Eliseen View Post
    [ssword]>tell weapon to return
    You don't even have one!
    You could add this line before the loop:

    Code:
    fput "spell active"
    I'm not sure why ;magic isn't picking up on whether or not you have 1025 running but spell active fixes it.

    Quote Originally Posted by Eliseen View Post
    Should there be an "end" at the end of this line? fput "tell weapon to return" if Spell[1025].active? && !GameObj.npcs.find{ |i| i.name =~ /#{script.vars[1]}/}
    An end isn't needed for this line.

    Quote Originally Posted by Eliseen View Post
    I didn't get the message that the sword was ceasing attacking anything. Perhaps it has to attack something first...
    Did you start the script with the person already in the room with you? The script as written wouldn't tell the sword to cease in that case.

  4. #24

    Default

    In line 34 there is the fput"spell active".

    so out hunting: mana ws low so it did kill 1025.

    >
    [ssword]>stop 1025
    [ssword: Running low on mana.]
    [ Song of Mirrors: +0:06:07, 0:06:07 remaining. ]
    Your animated longsword dissipates in a shower of sparkling motes of light.
    You stop singing Singing Sword Song.

    so I went and set down to wait to see what happened while I waited on mana:

    You sit down.
    s>
    [ssword]>tell weapon to return
    You don't even have one!
    s>
    started to scroll a lot finally did this:

    s>
    [ssword]>tell weapon to return
    You don't even have one!
    s>
    [ssword]>spell active
    You currently have the following active spells: listed all my spells
    then did this:
    s>
    [ssword]>prepare 1025
    You change your tune slightly, adding the element for Singing Sword Song to your song...
    Your spellsong is ready.
    s>
    [ssword]>cast longsword
    You weave another verse into your harmony.
    An animated longsword appears and hovers near you.
    Sing Roundtime 3 Seconds.
    s>
    [ssword]>spell active
    You currently have the following active spells:

    also I did hunt some pookas, this was the command I executed before hunting: ;ssword longsword pooka miner
    Strangly the sword did not attack any critters (yes pookas)
    Last edited by Eliseen; 01-03-2021 at 02:36 AM.

  5. #25

    Default

    Quote Originally Posted by Eliseen View Post
    In line 34 there is the fput"spell active".
    But that's only called if 1025 isn't active and since your ;magic thinks 1025 is active even when it isn't you would need to do a spell active outside of the loop so the script starts out knowing whether or not 1025 is active.

  6. #26

    Default

    I put the command before the loop and it still does weird things. I wonder if there is a bug in singing sword.

    by the way is this correct?

    if target
    if target_id != target.id
    fput "tell weapon to attack #{target}"
    target_id = target.id
    end
    Last edited by Eliseen; 01-03-2021 at 02:28 PM.

  7. #27

    Default

    Quote Originally Posted by Eliseen View Post
    I put the command before the loop and it still does weird things. I wonder if there is a bug in singing sword.

    by the way is this correct?

    if target
    if target_id != target.id
    fput "tell weapon to attack #{target}"
    target_id = target.id
    end
    Looks correct.

  8. #28

    Default

    I just wish I knew Ruby scripting. Some of the syntax really is strange != == #

    I mean what the heck does this mean =~ /#

    I'm used to Unix a bit of linx HTML Basic (used to know machine language) but the use of symbols is maddening.

    I've been wondering if a singing sword is coded similarly to a familiar. is if an NPC/obj/fam. is there a command like a one liner that I could run to verify what is in the room with me?
    Last edited by Eliseen; 01-03-2021 at 09:42 PM.

  9. #29

    Default

    Quote Originally Posted by Eliseen View Post
    Some of the syntax really is strange != == #
    Typically when you see an ! within Ruby it means the opposite or negates what you're doing.

    For example if you wanted to see if two values were the same you would do:

    fput "wave" if number1 == number2

    But if you wanted to see if two values were NOT the same you would do:

    fput "wave" if number1 != number2

    == is making a comparison between two values, similar to what I did above.

    So for example if you set the variable number to equal the number 4 you would do:

    number = 4

    If you then wanted to see if two values were the same you would do:

    fput "wave" if number == 4

    Quote Originally Posted by Eliseen View Post
    I mean what the heck does this mean =~ /#
    Doing something like

    if line =~ /text entered here/

    Is called a Regular Expression, or Regex. It's used when you don't want an exact match.

    For example if you did:

    if line == "text entered here"

    Then it would only be a match if the line were exactly "text entered here", no more and no less.

    If you used:

    if line =~ /text entered here/

    Then this text could appear anywhere within the line and it would be a match. It also allows you to do other things such as:

    if line =~ /text .* entered here/

    Where . is a wildcard and * means 0 or more matches, that way if you're not sure if there is anything between the words "text" and "entered" it can match it.

    Typically when you're using a variable within quotes or regex you use a # sign and put {} around it.

    So if you're using a variable named person you would do:

    fput "wave at #{person}"

    Same if you're trying to match a variable within a regex.

    fput "wave" if line =~ /#{person}/
    Last edited by Tgo01; 01-03-2021 at 10:09 PM.

  10. #30

    Default

    It's me again. I've muddled through the script and so far I've gotten positive results.
    Sings the weapon of your choice. and puts goodbye (what ever your choice was)
    When entering a room occupied it ceases activity.
    While script is running stands you back up if your knocked down. (forgot to put the stand command in the loop)
    It no longer tries to recall the sword while wall walking around or during the go2 script.

    I still need more testing in the attack department and will keep you updated.

    By the way, as you know armor hindrance can cause a song not to be sung, is there a line that can be added to resing if it fails on armor hindrance?
    Last edited by Eliseen; 01-05-2021 at 03:34 PM.

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
  •