# script for point cache

**URL:** <https://forums.chaos.com/t/script-for-point-cache/27168>\
**Category:** Off-topic\
**Created:** [February 15, 2011, 3:48pm UTC](https://forums.chaos.com/t/script-for-point-cache/27168 "2011-02-15T15:48:46Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![m\_hinks](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@m\_hinks](https://forums.chaos.com/u/m_hinks)\
**Post date:** [February 24, 2011, 5:13pm UTC](https://forums.chaos.com/t/script-for-point-cache/27168/21 "2011-02-24T17:13:49Z")

</div>

Thats really great, it works perfectly. I put the script on a ball, and removed it from all the peds. That script is now controlling the walk/idle of 10 peds perfectly.

Thanks you very much. I cant seem to get a 300k zip file uploaded on here for you to see, dont know why?

Here is the code;

MyArray = $Ped\* as array

for i = 1 to MyArray.count do  
(  
t0 = f-1  
t1 = f  
p0 = at time t0 myarray_.pos  
p1 = at time t1 myarray.pos_

 

_if p0==p1 then WM3\_MC\_SetValue myarray.morpher 1 0.0_

 

_else WM3\_MC\_SetValue myarray\*.morpher 1 100.0\*  
)_

 

_So all that is left know is getting the transition in the morpher to be over 5/6 frames, not “on/Off”_

 

_Thanks again._

---

<div class="post-metadata">

**Author:** ![joconnell](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/joconnell/32/36063_2.png) [@joconnell](https://forums.chaos.com/u/joconnell)\
**Post date:** [February 24, 2011, 5:47pm UTC](https://forums.chaos.com/t/script-for-point-cache/27168/22 "2011-02-24T17:47:02Z")

</div>

Probably something added on to the else WM3\_MC\_SetValue myarray\*.morpher 1 100.0 line.\*

Look into controllers and keyframes so that you can set a key at frame t (with t being the current frame) with a value of 0.0 and then at frame [t + 6] add a keyframe with a value of 100.

---

<div class="post-metadata">

**Author:** ![MoonDoggie](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/moondoggie/32/68517_2.png) [@MoonDoggie](https://forums.chaos.com/u/MoonDoggie)\
**Post date:** [February 24, 2011, 7:24pm UTC](https://forums.chaos.com/t/script-for-point-cache/27168/23 "2011-02-24T19:24:26Z")

</div>

```auto

MyArray = $Ped* as array

for i = 1 to MyArray.count do
(
     animate on (
          for t in 0 to 100 by 5 do (
               at time t 
                    WM3_MC_SetValue MyArray[i].morpher 1 t -- the t variable is the frame time (0,5,10,15...100)
          )
     )

)

```

I have no idea what the variable f is or anything so your code doesn’t make any sense to me.

but try something like the above. I just can’t decipher this without some of the variable information.

---

<div class="post-metadata">

**Author:** ![m\_hinks](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@m\_hinks](https://forums.chaos.com/u/m_hinks)\
**Post date:** [February 25, 2011, 2:49pm UTC](https://forums.chaos.com/t/script-for-point-cache/27168/24 "2011-02-25T14:49:52Z")

</div>

Sorry Colin, the variables are just the pre-set ones in the script controller dialog.

f = frames  
t = ticks  
s = seconds  
nt = norm time

I shall give your new script a go right now, thanks for your input.

Stupid question, but where would you put this script, or how would you have it running in a scene. I’m sure my way is not the best/right!!

M

[Previous page](https://forums.chaos.com/t/script-for-point-cache/27168.md?page=1)
