|
Development Forum |
 |
| Savannahs11's Question Pile 1 | 2 | |
| 
the1whoscreams
  
|
10/6/2017 | |
Thanks, Grendel Man.
Did you know? When I made this account, the year was 2014 and I was eleven years old. |

the1whoscreams
  
|
10/7/2017 | |
How do you have an agent use only a specific part of a sound? I know there are some agents that do that.
EDIT: Actually, how do you get an agent to do something if it hits the ground hard enough?
Did you know? When I made this account, the year was 2014 and I was eleven years old. |

the1whoscreams
  
|
10/7/2017 | |
Sorry for the triple-post, but how do you get STPC to work right? I know you have to use SNDC, and I'm doing that, but when I try to make it wait for more than a few ticks, the sound plays in its entirety and the animation never takes place.
scrp 2 25 14895 6
doif _p2_ ge 20
attr 192
sndc "crak"
wait 10
stpc
frat 3
anim [1 2 3 4 5 6 7]
endi
endm |
Here, I'm trying to get it to play only the first half-second of the sound file, then animate.
Did you know? When I made this account, the year was 2014 and I was eleven years old. |

GimmeCat
  
|
10/7/2017 | |
Are we sure it's possible to prematurely end a soundclip? Looking at the Piranha example here, your code looks basically the same. So if yours plays the whole sound, I'm not convinced the Piranha doesn't, too.
Not sure why that would prevent the animation from happening, though.
It might be simpler to just snip the .wav in half with a program like Audacity. |

the1whoscreams
  
|
10/7/2017 | |
The Norn Terrarium recycler ends its sound early. There's more to the sound that plays, and you can't hear it by default unless your game is lagging horrifically, so it's definitely possible, and if it weren't, why would that command be there in the first place?
Did you know? When I made this account, the year was 2014 and I was eleven years old. |

GimmeCat
  
|
10/7/2017 | |
Good point. |

Malkin
     Manager

|
10/7/2017 | |
The DS eggs use the following code:
targ ownr
anim [4 5 6 4 5 6 4 5 6 3 3 6 4 5 6 4 4 5 6 3]
snde "crak"
over
stpc
wait 30 |
so it's animate, noise, finish animation, finish noise, then wait.
You've got noise, wait, stop noise, animate.
Maybe switching up the order a bit might help?
I don't think the recycler uses STPC, only the piranha and creature egg scripts seem to.
My TCR Norns |

the1whoscreams
  
|
10/7/2017 | 1 |
The way it's acting is making me think the game itself is bugged, because if I set the WAIT to something right away, it freaks out and breaks, but if I JECT 7 it several times, slowly increasing the WAIT time to that same number, it works just fine.
Did you know? When I made this account, the year was 2014 and I was eleven years old. |

Malkin
     Manager

|
10/7/2017 | |
STPC and SNDC have been around as a command pair since C1, so it's possible there are some oddities with them?
My TCR Norns |

Zzzzoot

|
10/7/2017 | |
...when I try to make it wait for more than a few ticks, the sound plays in its entirety and the animation never takes place.
This is just a guess, but that sounds like your script is being interrupted. If so, putting LOCK and UNLK around that section should fix it.
That would be odd though, from everything else you've said about your agent, I don't think (also a guess) that there are too many other scripts running on it. |

the1whoscreams
  
|
10/8/2017 | |
Huh. Locking the script fixed the sound thing. It makes no sense, because the agent that had the problem is very simple, and it should never have more than one script trying to run at once.
Did you know? When I made this account, the year was 2014 and I was eleven years old. |

the1whoscreams
  
|
10/8/2017 | |
How do you set the TARG to a specific agent in the world? My agent can create a critter and assign a metric buttload of variables to it, but now, it needs to briefly return the TARG to the machine and send a message to another buttload of buttons so that they reflect said variables before putting the TARG back on the critter. Also, is it possible to have an agent directly access the variables of another?
Did you know? When I made this account, the year was 2014 and I was eleven years old. |

GimmeCat
  
|
10/9/2017 | |
TARG OWNR returns targ to the agent executing the script.
Edit: My bad, I'm tired and didn't read correctly. Is there a reason why you can't send the messages to the buttons first, then create the critter and set its variables?
Don't know about the other thing, but I imagine it's possible. You can do it with enum of course, but that will affect all/random instances of the critter. If you want to target a specific one, you'll need some other way of narrowing down the selection to a specific one. "doif touc targ ownr gt 0" coupled with an enum loop will affect any critters currently touching the agent.
You could also increment a variable on the agent each time a new critter is created, and set that var on the critter like a unique ID number. Then do if its ID = the same number the agent is on. |

Zzzzoot

|
10/9/2017 | |
Now that I'm rereading your post in the morning, I think I see what you're wanting to do. You can set agents as variables like:
new: simp blahblahblah
seta va00 targ
new: simp blahblahblah
seta va01 targ
seta ov00 va00
targ va00
seta ov00 va01 |
This script will make 2 new agents and set each of their ov00 variables to the other. So each agent can do stuff with the other later on. Like set up a timer and use SEEE to make sure both agents can see each other. If not you can have them say "I'm lonely, where's my buddy" or whatever.
There's also OWNR, which returns the owner of the script. You'd use SEEE like this:
scrp blah blah 9
doif seee ownr ov00 = 0
*complain about being lonely
endi
endm |
edit:
After re-re-reading you message I see what you were actually asking was a lot simpler. I'll leave my original answer up because I think it does help, but here's a shorter chunk of code that does what (I think) you want to do:
new: simp blahblahblah
*do stuff with the agent we just made
seta va00 targ
targ ownr
*do stuff with ownr
targ va00
*do more stuff with the agent we just made
|
|
|