Page 1 of 2

Telekinesis

Posted: Mon Jun 07, 2010 2:43 pm
by Ronald McDonald
You use to be able to use this on potions,food,lanterns,torches,books,ale,scrolls ect.. not just on doors and chests.

Re: Telekinesis

Posted: Mon Jun 07, 2010 3:08 pm
by MatronDeWinter
I have noticed that you cant telekenesis the back side of a locked door. (It should say "you open the door from the inside" or whatever)

Re: Telekinesis

Posted: Mon Jun 07, 2010 3:42 pm
by Populus
You should also be able to telekinesis the hatch on a boat, now it says "That is not accessible".

Re: Telekinesis

Posted: Wed Jun 09, 2010 6:50 pm
by Fwerp
You should also be able to telekinesis a guildstone as well.

Re: Telekinesis

Posted: Wed Jun 09, 2010 11:13 pm
by MatronDeWinter
So basically telekenesis should be just like a double-click, only without the range check. Well with a spell-casting range/LOS check, but not the use-range.

Re: Telekinesis

Posted: Thu Jun 10, 2010 2:01 am
by Truksama
MatronDeWinter wrote:So basically telekenesis should be just like a double-click, only without the range check. Well with a spell-casting range/LOS check, but not the use-range.
I think this is correct, yes.

Re: Telekinesis

Posted: Thu Jun 10, 2010 8:30 am
by Faust
Simply look at the Original OSI code for the spell.

Re: Telekinesis

Posted: Fri Jun 11, 2010 11:37 am
by Stuck
I looked at the demo code for telekinesis and interpreted it as best I could. After looking at all the functions and trying to figure out exactly what they did, I commented every line that calls a function, attempting to explain what that function does:

(Keep in mind, I'm not 100% sure this is exactly what these functions do. This is just what I gathered from looking at the code for each function.)

Code: Select all

on targetobj(object user, object usedon)
{
  if(!Q4C8(user, this)) //makes sure the user is allowed to target and doesnt currently have a target??
  {
    return(0x01);
  }
  if(usedon == NULL()) //returns if nothing is targeted - most likely if "esc" is pressed and the targeting is canceled
  {
    return(0x00);
  }
  if(!Q4CU(user, usedon)) //checks to make sure the targeted object "is valid" and is in line of sight
  {
    return(0x00);
  }
  if(Q5UM(user, usedon, 0x0C)) //checks line of sight again, also checks distance - if the object is further than 12 tiles away it returns
  {
    if(!Q5YC(user, this)) //checks to make sure the telekinesis scroll is in a container if youre using a scroll, otherwise checks for necessary reagents
    {
      return(0x00);
    }
    if(Q4LT(user, getLocation(usedon), this)) //reveals you if hidden, makes sure spell casting is allowed at that location, determines whether the cast is a success, reduces mana if successful
    {
      Q4ML(user, usedon); //called when a target is valid, look below
    }
    else
    {
      Q4RD(user); //causes the spell to fizzle if the cast was not successful
    }
  }
  return(0x00);
}

function integer Q4ML(object user, object usedon) //called if the cast is successful and the target is valid
{
  integer Q5NC = 0x00;
  if(Q4CU(user, usedon)) //another check to make sure the targeted object "is valid" and is in line of sight
  {
    location Q4VS = getLocation(user);
    location there = getLocation(usedon);
    faceHere(user, getDirectionInternal(Q4VS, there)); //makes you face the item
    doLocAnimation(getLocation(usedon), 0x376A, 0x09, 0x20, 0x00, 0x00); //does the sparkly animation near the targeted item?
    sfx(there, 0x01F5, 0x00); //makes the telekinesis sound
    useItem(user, usedon); //this would be the most important function were looking for
    Q5NC = 0x01;
  }
  Q5UQ(this); //shortcallback
  return(Q5NC); //returns 1 if successfully cast and 0 otherwise, but this is seemingly irrelevant because when this is called by ontargetobj, it ignores the return value
}
I couldn't find any code in the scripts for useItem(). I'm guessing it does just what it says.

The only function that made me question whether telekinesis is just like double clicking something from range was the Q4CU function, which runs the isValid() function on the targeted item:

Code: Select all

function integer Q4CU(object user, object usedon)
{
  if(!isValid(usedon)) //checks to see if the targetted item "is valid"? my guess is this checks to see if the item actually exists
  {
    return(0x00);
  }
  if(!canSeeObj(user, usedon)) //checks line of sight
  {
    systemMessage(user, "Target can not be seen");
    return(0x00);
  }
  return(0x01);
}
I couldn't find any code for the isValid() function either. My guess was is that it checks to make sure the targeted item actually exists, but I'm not sure.

Re: Telekinesis

Posted: Fri Jun 11, 2010 12:08 pm
by Faust
Those are probably core functions that would have to be read in assembly by Batlin.

Re: Telekinesis

Posted: Mon Jun 14, 2010 6:06 pm
by Stuck
I spoke to Batlin about the isValid() and useItem() functions above. He told me that isValid() only checks to see if an item exists. He also said that, more or less, useItem() would be the same as double-clicking an item.

I'll mess around on the demo to see exactly how and what telekinesis works on.

Re: Telekinesis

Posted: Mon Jun 14, 2010 6:25 pm
by Hicha
Everyone is a programmer.

Re: Telekinesis

Posted: Mon Jun 14, 2010 11:20 pm
by Derrick
WHile useItem() would be the same as double clicking it, a house door then does a special check to see which side of the door you are on. That file may prove interesting in regards to this.

Re: Telekinesis

Posted: Sun Aug 18, 2013 3:42 am
by prosonic
we used to use Telekinesis to steal ore off boats by combining it just like a double click

Re: Telekinesis

Posted: Sun Aug 18, 2013 10:40 am
by Robbbb
prosonic wrote:we used to use Telekinesis to steal ore off boats by combining it just like a double click
https://groups.google.com/forum/#!searc ... 0yHINT-SMJ

12/21/1998
cast telekinesis, target the orepile you want to steal, target the 1 or
more ore on your own boat and voilá, the ore on the target boat is
combined into your stack.


https://groups.google.com/forum/#!searc ... HHCJoaE7EJ


9/21/1999
> can another person steal ore off my boat by using their plank? or use
> telekinesis?

Defintally. I set myself up and watched this happen. All the goon needs to
do is have the ore on the plank or manage to drop the ore on the deck and
then use telekenisis to double-click your pile and combine it with his.

Re: Telekinesis

Posted: Sun Aug 18, 2013 12:58 pm
by Roser
Great thread! and nice find rob!