Jump to content

ObjectRef.MoveTo Player isn't working?


snakejawz

Recommended Posts

Ok this is driving me CRAZY especially because every tutorial and every piece of code i have scrounged up says to do it the same way...

 

Here is my script with the non-working part piece remarked.

 

scn 1SJspawnrat

Begin ScriptEffectStart

if player.GetItemCount Ratmeat >= 10
;1SJRatRef.moveto player  ;why doesnt this work?
player.placeatme 1SJrat 1 10 1
player.removeitem Ratmeat 10
Message "You created a Rat"
else
MessageBox "You need at least 10 pieces of Rat Meat to summon this creature.", Ok
endif

end

 

If someone could look at this and give me suggestions why it isn't working?

 

Yes i have a dummy cell

Yes the rat is in it and named properly

Yes i have tried with just the raw ref ID code.

 

The editor acts like the rat doesnt exist. I've also gotten some other odd responses from it too...

maybe does my TESC4 need to be reinstalled?

 

I am also having problems adding AI packages since none of my scripts will recognize the actor references...

Link to comment
Share on other sites

Have you tried using the form ID for the ratmeat instead of the editor ID? It may not be working because it doesn't register that the player has that many of that item. Although the script editor recognizes the editor IDs, when used in game it doesn't.

 

As for the packaging, you add those directly to the creature within the AI tab. If the creature being referenced is just your standard rat without a unique editor ID, you would have to either replace it with one, or add an ability to that specific rat (after it is being summoned) which would control packages. Honestly, unless you absolutly need the rat to be a persistant reference, you're just better off making a rat with a unique editor ID, and just using player.placeatme <form ID of rat> , Then you don't need to fuss around with a holding cell, packaging to make them stay in that cell when not being used, and controlling their respawn. Using moveto really only makes sense in cases where that Creature or NPC must retain some information which cannot be stored elsewhere.

Link to comment
Share on other sites

The removal of the rat meat ISN'T the problem.... i wish it was :D

 

the problem is the remarked line with the moveto part....

 

i am trying to use this same code on NPC's as well, and it acts like my persistent references DON'T exist

even though i have them in their own cell, and have persistent names for them.

all unique actors, nothing currently in game

 

the only way i have been able to successfully place them at the player is with the placeatme command

moveto acts as if they dont exist, even in game. >:(

 

maybe i could upload a copy of the esp and you could take a look and see if it works for you :P

Link to comment
Share on other sites

I'm saying the "if player.GetItemCount Ratmeat >= 10" part is probably where you need to change it to use the form IDs. Trying to use moveto player in game doesn't work since you need the actual hex number for the reference based on the load order of the .esp, so it's only natural that it wouldn't work when you try it in game. What I'm saying is that it may not be initiating the scripting where it would move the NPC to the player since the conditions aren't being recognized. Try commenting out the If statments, the script should work.

 

Try this, if the references are right.

scn 1SJspawnrat

Begin ScriptEffectStart
1SJRatRef.moveto player
Message "You created a Rat"
end

If not, what messages were being shown when you ran your script?

Link to comment
Share on other sites

i copied the exact script you wrote with a new name

 

scn 1SJspawnratNEW

Begin ScriptEffectStart
1SJRatRef.moveto player
Message "You created a Rat"
end

 

and it gave me this error

 

Script '1SJspawnratNEW', line 4:
Script command "1SJRatRef.moveto" not found

 

i tried to say before the removal of the rat meat worked FINE, it doesn't recognize the persistent reference to the rat i made in my void cell.

 

it wouldnt allow me to upload the file to the forum?

Link to comment
Share on other sites

If you want to upload it to the forum you should either change the extension to .txt (Someone else can change it back to .esp after receiving it) or by putting it in a .rar file.

 

;1SJRatRef.moveto player ;why doesnt this work?

player.placeatme 1SJrat 1 10 1

Why do you first move a rat that's in a cell already to the player, but after that try to spawn a new one as well? If the script worked, wouldn't you get two rats then?

 

You should probably remove the ; before 1SJRatRef as well.

 

I'm not sure, but maybe you should change 1 10 1 to 1,10,1.

 

In your new script there's a space between '1SJRatRef' and 'moveto'.

Link to comment
Share on other sites

I'm trying to make a spell that spawns rats, it was originally supposed to move a static ref rat to the player, then move it back, but that wouldn't work cause of the moveto bug im having, so i used placeatme instead. Being a contentious coder i know placeatme causes bloat so i want to find out why the moveto isnt working...

 

PS here is the plugin, all of my modifications are made with the 1SJ prefix

 

this is actually 2 plugins...lol that kinda got merged during testing...hehe

1 bags at houses

2 spells that summon creatures, npc, etc...

 

the summon spells are where all my problems have been with moveto

i am also having issues getting my tesc4 recognizing Var's attached to quests...but thats another topic

Link to comment
Share on other sites

Thanks anyways i'm hopeing Vagrant0 checks back, this is gonna drive me up a wall....it SHOULD work, yet it doesnt...

 

But, tell me if this code will compile or work for anyone else, then ill know if the problem is with the CS otr just my version....

 

scn 1SJspawnrat

Begin ScriptEffectStart
1SJRatRef.moveto player
Message "You created a Rat"
end

 

thanks

Link to comment
Share on other sites

I have the 1.1 CS, so I'm no help. Provided that you have a ref placed with that name (it isn't the editor ID, but the reference you placed in the world given a specific designation) and that both the script and the creature are both within the same mod, with the same offset (01xxxxxx), there shouldn't be any issue. There shouldn't be a space between ref.moveto, though it looks like there is in that code box (blame the font).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...