Difference between revisions of "Talk:PlaceAtMe"

2,684 bytes added ,  01:28, 17 January 2008
→‎Placeatme in scripts: warning about bloat, some answers, some questions
imported>Mr. V
imported>DragoonWraith
(→‎Placeatme in scripts: warning about bloat, some answers, some questions)
Line 105: Line 105:
I am currently working on a script for a sword that turns someone into a cheese wheel. This is my Script.
I am currently working on a script for a sword that turns someone into a cheese wheel. This is my Script.


Begin ScriptEffectStart
Begin ScriptEffectStart
    PlaceAtMe CheeseWheel 1 0 0
  PlaceAtMe CheeseWheel 1 0 0
    Disable
  Disable
End
End


Unfortunately, when the cheese appears and the target disappears, the cheese has collision lock on and is sometimes stuck beneath the ground.  Could someone tell me whats wrong?(This is my first official script)-[[User:Mr. V|Mr. V]] 21:08, 16 January 2008 (EST)
Unfortunately, when the cheese appears and the target disappears, the cheese has collision lock on and is sometimes stuck beneath the ground.  Could someone tell me whats wrong?(This is my first official script)-[[User:Mr. V|Mr. V]] 21:08, 16 January 2008 (EST)
:First of all, you probably don't want to be using the normal CheeseWheel - since this is a food object, the player may pick it up, and that may cause serious problems (unless this is what you intend). Instead, create a new Activator that uses the CheeseWheel model (you may have to get the model out of the BSA - I recommend [[OBMM]] for that), and use that.
:The "spawn point" for PlaceAtMe is wherever "Me"'s XYZ coordinates are. For NPCs, this is in between their feet. And since the cheesewheel's XYZ refer to its center, half of the wheel would be lodged in the ground.
:You could try this:
ref CheeseRef
float z
Begin ScriptEffectStart
  set CheeseRef to PlaceAtMe ActivCheeseWheel 1 0 0
  set z to ( CheeseRef.GetPos Z ) + 64
  CheeseRef.SetPos Z z
  Disable
End
:However, you should note that this is going to cause savegame bloat. The cheesewheel is going to be added to the savegame every time this happens, and eventually that's going to harm players' savegames. This is considered very poor modder etiquette.
:If you can limit the number of cheesewheels possible at one time, you could use Persistent References and [[MoveTo]] instead, to avoid this problem.
:Alternatively, you could make the effect timed, and make sure you have enough wheels that it's unlikely for the player to hit more people than you have wheels.
:Perhaps the ultimate compromise would be to keep old wheels somewhere, and re-use them - this was you could create as many as you need, without creating infinite. This would require fairly complicated scripting, however.
:Ironically, the cheesewheel that you ''can'' pick up may be able to avoid these problems by being picked up - I ''think'' that removes the reference and cleans the savegame. You'll need to look into that, assuming the thing being pick-up-able is OK. If you do this, make sure that you still make a new object for it.
:'''If''' picking up the cheesewheel works to prevent bloat, but you don't want the player to pick it up, you might use a script on it that has an OnActivate block that prevents it from being picked up, except by your special "cleaning crew" container. I can help with that script, but like I said, I don't know if the picking up thing works, so you'll have to figure that out first - I'd suggest asking on the [http://www.bethsoft.com/bgsforums/index.php?showforum=24 Elder Scrolls Forums].
:[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 01:28, 17 January 2008 (EST)