City of Arabel

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    On Spawn

    Scripting
    2
    4
    1736
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mr.Moloch
      Mr.Moloch last edited by

      This isn't working, and I'm baffled. It should. What have I got wrong for this in an OnSpawn script?

        string sMyCorpse = GetLocalString(OBJECT_SELF, "sMyCorpse");
          object oMyCorpse = CreateObject(OBJECT_TYPE_CREATURE, "sMyCorpse", GetLocation(OBJECT_SELF), FALSE);
          //Debug
          SpeakString(sMyCorpse, TALKVOLUME_TALK);
              SetImmortal(oMyCorpse, TRUE);
      

      In the future, there are two simple rules to remember:

      NO SPITTING.

      DO NOT CROSS MISTER MOLOCH.

      https://youtu.be/WsMMN9Y9uEw

      1 Reply Last reply Reply Quote
      • Zool
        Zool last edited by

        So… it is supposed to spawn a corpse item into the inventory of the creature when they spawn, based on a variable you set on the creature spawning?

        wait.. can't be an item into inventory as its using location to spawn, and also its creature object type.

        So this spawns another creature?

        nevermind! I think its this

        object oMyCorpse = CreateObject(OBJECT_TYPE_CREATURE, "sMyCorpse", GetLocation(OBJECT_SELF), FALSE);

        Should not have " " around sMyCorpse, as you are trying to use the contents of the variable, not spawn something with the resref sMyCorpse.

        > !!!MOLES for the MOLE GOD!!!

        1 Reply Last reply Reply Quote
        • Mr.Moloch
          Mr.Moloch last edited by

          Doi, always something simple. I'll try that. This is what you get for writing things when you're sleepy.

          In the future, there are two simple rules to remember:

          NO SPITTING.

          DO NOT CROSS MISTER MOLOCH.

          https://youtu.be/WsMMN9Y9uEw

          1 Reply Last reply Reply Quote
          • Zool
            Zool last edited by

            yup easy mistake, made it about a bajillion times myself.

            > !!!MOLES for the MOLE GOD!!!

            1 Reply Last reply Reply Quote
            • 1 / 1
            • First post
              Last post