1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Few issues with my first script (rideable tiger)

Discussion in 'Script Support' started by DelBoy, Feb 17, 2014.

  1. DelBoy
    Offline

    DelBoy New Member

    Joined:
    Feb 16, 2014
    Messages:
    24
    Likes Received:
    2
    Publish Number:
    54
    Had a look for a script for a Rideable Tiger and the only one I could find was the ethy one by Goober so thought I should try and make one.

    So the issues I have with it:
    1 Line 22 When you add it it just adds the one colour and not either the light or dark one as intended, I might have the or in the wrong place Edit: Solved thanks to Ce Jayce and swiftorb
    Code (C#):
    1. this.Body = 1254 | 1255;
    2 Line 99 I had to comment it out as it gives an error
    Code (C#):
    1.  
    2. ----------------------------------------------------------------------------
    3. ServUO - [http://www.servuo.com] Version 0.5, Build 5160.3345
    4. Publish 54
    5. Core: Optimizing for 4 64-bit processors
    6. RandomImpl: CSPRandom (Software)
    7. Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
    8. Errors:
    9. + Custom Systems/Mobs/Mounts/Tiger.cs:
    10.     CS0246: Line 99: The type or namespace name 'WeaponAbility' could not be found (are you missing a using direct
    11. ive or an assembly reference?)
    12. Scripts: One or more scripts failed to compile or no script files were found.
    13. - Press return to exit, or R to try again.
    14.  
    3 I borrowed the itemId from goobers tiger ethy and now if you have the dark tiger when you mount it, it changes to the light tiger Edit: Solved thanks to Ce Jayce and swiftorb

    Any advice is greatly appreciated and constructive criticism (please be kind its my first time :))

    Edit: Uploaded the new file.
     

    Attached Files:

    #1 DelBoy, Feb 17, 2014
    Last edited: Feb 17, 2014
    • Helpful Helpful x 1
  2. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Hey there!
    Take out your line
    Code (C#):
    1. this.Body = 1254 | 1255;
    The compiler is compiling that code and setting the id to 1254 and then to 1255 with that - so it will always end up at 1255

    Code (C#):
    1.             switch (Utility.Random(2))
    2.             {
    3.                 case 0:
    4.                     {
    5.                         this.BodyValue = 1254;
    6.                         this.ItemID = *light ID here*;
    7.                         break;
    8.                     }
    9.                 case 1:
    10.                     {
    11.                         this.BodyValue = 1255;
    12.                         this.ItemID = *dark ID here*;
    13.                         break;
    14.                     }
    15.             }
    I took the above code from Nightmare.cs and edited it slightly - you'll need to put in the item ids of both the male/female (dark/light) versions but that will randomly select one of the two.

    Hope that helps somewhat! :)
     
    • Like Like x 1
  3. swiftorb
    Offline

    swiftorb Member

    Joined:
    Feb 17, 2014
    Messages:
    40
    Likes Received:
    0
    Code (C#):
    1.  
    2.       switch ( Utility.Random( 2 ) )
    3.        {
    4.          case 0:
    5.          {
    6.            BodyValue = 1254;
    7.            ItemID = 16071; //male
    8.            break;
    9.          }
    10.          case 1:
    11.          {
    12.            BodyValue = 1255;
    13.            ItemID = 16072; //female
    14.            break;
    15.          }
    16.        
    17.   }
    18.  
     
    • Two Thumbs Up Two Thumbs Up x 1
    • Helpful Helpful x 1
  4. swiftorb
    Offline

    swiftorb Member

    Joined:
    Feb 17, 2014
    Messages:
    40
    Likes Received:
    0
    I would like to know the ID for the statue if you shrink it ? This script is shrinks to a ball :(
     
  5. DelBoy
    Offline

    DelBoy New Member

    Joined:
    Feb 16, 2014
    Messages:
    24
    Likes Received:
    2
    Awesome that works so they spawn
    I am going to try and find a shrink system and then mess around with the values when its shrunk then change it if I can work out how, also I have an idea for a cool custom drop for it, not sure if it will work though:confused: however I can try and if it doesn't work I will have found one way of not doing it :).

    Any ideas on why the WeaponAbility throws an error?
     
  6. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    That's an easy one, just got to add
    Code (C#):
    1. using Server.Items;
    just under the other two:
    Code (C#):
    1. using System;
    2. using Server.Mobiles;
    WeaponAbility is an Item method rather than a Mobile one so you need to make sure you point the code to use that reference too! :)
     
  7. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Also,
    The ItemID for the tiger statuette you want when it's shrunk it 38980 ! :)
     
    • Winner Winner x 1
  8. DelBoy
    Offline

    DelBoy New Member

    Joined:
    Feb 16, 2014
    Messages:
    24
    Likes Received:
    2
    Ok I give up I have no idea where to put that, I'm guessing it possibly has to go in shrink.cfg?

    Quick question I'm working on the drop for the tiger and am not sure whether Utility.Random( 53 ) = random number from 0-52?
    and will Utility.RandomMinMax( 10 ) = random number from 0-9 if so, if I want to add 1 to that should I make it
    Utility.RandomMinMax( 10 +1 ) or Utility.RandomMinMax( 10 ) +1?
     
  9. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Not sure which shrink system you're using but the ID for it will need to go in there rather than the Tiger.cs file


    Code (C#):
    1. (Utility.RandomMinMax( 10 ) +1 )
    would be between 1 and 9
    and
    Code (C#):
    1. Utility.RandomMinMax( 10 + 1 )
    would be between 0 and 10 as you're basically doing Utility.RandomMinMax( 11 ) there.
     
  10. DelBoy
    Offline

    DelBoy New Member

    Joined:
    Feb 16, 2014
    Messages:
    24
    Likes Received:
    2
    hmm :confused: so if I wanted to get a value between 1 and 10 would this work or is it going to return 1-9?
    Code (C#):
    1. int value = Utility.RandomMinMax( 1, 10 )
    sorry I'm new to C# and I forgot the [ code ] tags last time and only put one value in :rolleyes:

    Thanks for your help
     
  11. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    hehe no worries on the code tags, not that important for a single line of code just helps for long scripts :p
    RandomMinMax(1, 10) would give you 1 - 10 so that's what you're after by the sounds of things! :)

    I'd encourage you to post your script in the Archive once you've finished it - You don't have to of course as it's your work but it may be nice for others :)
     
  12. DelBoy
    Offline

    DelBoy New Member

    Joined:
    Feb 16, 2014
    Messages:
    24
    Likes Received:
    2
    I intend to, I'm just working on the loot drop for it, hopefully you and others will like it, I may need more help soon though, probably tomorrow as I have been up for nearly 24 hours lol, my first script is turning quite complicated
     
  13. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Well i'll be around to help out if you need as i'm sure others will be! :)
    Get some rest and come back to this tomorrow! :)
     
  14. swiftorb
    Offline

    swiftorb Member

    Joined:
    Feb 17, 2014
    Messages:
    40
    Likes Received:
    0
    Would I first have to script in the Idol ?
     
  15. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,432
    Likes Received:
    385
    You will need to create a script for this if you want to give the statue as a reward or drop item.
     
    • Helpful Helpful x 1
  16. swiftorb
    Offline

    swiftorb Member

    Joined:
    Feb 17, 2014
    Messages:
    40
    Likes Received:
    0
    HaHa I managed to make an Idol that turned me into a Tiger :eek:
     
  17. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,432
    Likes Received:
    385
    I have had this script for a long time and used it in my mechanical pet crafting
    Just change the name to what your tiger is named .
    (when you click the statue you will get the ridable tiger which you scripted.)
    MechanicalPetStatue <<use the name of your tiger script
    also if you do not want the pet to be bonded when released change this
    dragon.IsBonded = true; <<change to false
    Only change the name to that of which your tiger script is named :)
    Note: this does not create an evo pet , just works with a timer to release the pet
     

    Attached Files:

    • Helpful Helpful x 1
  18. swiftorb
    Offline

    swiftorb Member

    Joined:
    Feb 17, 2014
    Messages:
    40
    Likes Received:
    0
    I was actually thinking I had to add a Tiger statue as my edit to Shrink.cfg hasn't done anything.
    I tried these

    Code (C#):
    1.  
    2. 1254 38980
    3. 1255 38980
    and also
    Code (C#):
    1.  
    2. 1254 0x9844
    3. 1255 0x9844
    4.  
     
  19. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,432
    Likes Received:
    385
    I believe you need to add it to bodytable.cs also, since this is a new mount (numbers)
    this script you can find in the Data folder
     
  20. swiftorb
    Offline

    swiftorb Member

    Joined:
    Feb 17, 2014
    Messages:
    40
    Likes Received:
    0
    They are already in there

    1254 Animal # Tiger
    1255 Animal # Tiger
     
Similar Threads: Few issues
Forum Title Date
ServUO Discussion A few questions Saturday at 4:07 PM
Script Support Few things May 11, 2017
New Join Forum Few Questions Mar 26, 2017
The Back Room So, Few days ago, RunUO site has been closed. Oct 18, 2016
ServUO Discussion Few questions Sep 11, 2016
General Discussion I am Looking for a few Custom Creatures Aug 7, 2016
Looking For Help Looking to Team up with a few people Aug 3, 2016