Guest User

Untitled

a guest
Dec 13th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.95 KB | None | 0 0
  1. * start install script
  2. inst
  3.  
  4. * First, detect metarooms
  5. * Chione coords
  6. doif gmap 40704 21781 <> -1
  7. setv va01 1
  8. endi
  9. * NPole coords
  10. doif gmap 552 5495 <> -1
  11. setv va02 1
  12. endi
  13.  
  14. * Spawn 10 planted carrots in Chione
  15. doif va01 eq 1
  16. reps 10
  17. gsub car1
  18. * x and y coords for Chione. x1 is the leftest, x2 is the rightest. Spawn randomly within this range.
  19. mvto rand 40704 41800 21573
  20. repe
  21. endi
  22.  
  23.  
  24. * Spawn 10 uprooted carrots in Chione
  25. doif va01 eq 1
  26. reps 10
  27. gsub car2
  28. * x and y coords for Chione
  29. mvto rand 40704 41800 21573
  30. repe
  31. endi
  32.  
  33. * Spawn 10 planted carrots in NPole
  34. doif va02 eq 1
  35. reps 10
  36. gsub car1
  37. * x and y coords for NPole. x1 is the leftest, x2 is the rightest. Spawn randomly within this range.
  38. mvto rand 552 750 5090
  39. repe
  40. endi
  41.  
  42. * Spawn 10 uprooted carrots in NPole
  43. doif va02 eq 1
  44. reps 10
  45. gsub car2
  46. * x and y coords for NPole
  47. mvto rand 552 750 5090
  48. repe
  49. endi
  50.  
  51.  
  52. * If no metarooms exist, spawn in Norn Terranium
  53. doif va01 ne 1 and va02 ne 1
  54. reps 10
  55. gsub car1
  56. mvto rand 500 1200 500
  57. repe
  58. reps 10
  59. gsub car2
  60. repe
  61. endi
  62.  
  63. subr car1
  64. new: simp 2 11 14879 "needlcarr" 7 0 50
  65. attr 199
  66. accg 5
  67. aero 20
  68. bhvr 48
  69. elas 0
  70. setv ov61 60
  71. emit 8 0.5
  72. retn
  73.  
  74. subr car2
  75. new: simp 2 11 14879 "needlcarr" 7 0 5000
  76. attr 199
  77. accg 5
  78. aero 20
  79. bhvr 48
  80. elas 0
  81. setv ov61 60
  82. emit 8 0.5
  83. setv va00 rand 0 1
  84. mulv va00 4
  85. addv va00 2
  86. pose va00
  87. perm 60
  88. tick 2400
  89. retn
  90.  
  91. endm
  92.  
  93.  
  94. * carrot pick up script
  95. scrp 2 11 14879 4
  96. * set pose to 1 when picked up (carrot vertical)
  97. pose 1
  98. perm 60
  99.  
  100. endm
  101.  
  102.  
  103. * collision script (normal carrots)
  104. scrp 2 11 14879 6
  105. lock
  106. sndc "smit"
  107. endm
  108.  
  109. * collision script (rotting carrots)
  110. scrp 2 10 14879 6
  111. lock
  112. sndc "smit"
  113. endm
  114.  
  115.  
  116. * carrot dropped script
  117. scrp 2 11 14879 5
  118. inst
  119. * if timer not initialized
  120. doif tick eq 0
  121. * set 8 min timer
  122. tick 2400
  123. endi
  124. * create temporary variable randomly 0 or 1
  125. setv va00 rand 0 1
  126. * multiply b4
  127. mulv va00 4
  128. * add 2
  129. addv va00 2
  130. * set pose to result (carrot lays on floor facing a random direction)
  131. pose va00
  132. * do if not being carried
  133. doif carr eq null
  134. * set z = middle ground
  135. plne 5000
  136. endi
  137. endm
  138.  
  139.  
  140. * carrot timer script - I HATE THESE!
  141. scrp 2 11 14879 9
  142. * do if not being carried, not falling
  143. doif carr eq null and fall eq 0
  144. inst
  145. * temporary var tracking X coord
  146. setv va00 posl
  147. * temporary var tracking Y coord
  148. setv va01 post
  149.  
  150. setv va02 rand 0 1
  151. mulv va02 4
  152. addv va02 2
  153. * spawn detritus carrot, has 4 images starting from image #2 or #6, z = middle ground
  154. new: simp 2 10 14879 "needlcarr" 4 va02 5001
  155.  
  156. * in carr.c16, detritus images are 2,3,4,5 (uneaten, facing right) or 6,7,8,9 (uneaten, facing left)
  157.  
  158. accg 5
  159. aero 20
  160. * suffers gravity, has boundaries, can be moused, can be carried
  161. attr 195
  162. * can be picked up, can be eaten - why would you?!
  163. bhvr 48
  164. elas 0
  165. * do if position of the saved X & Y coords of the healthy carrot is valid (i.e. not in a wall)
  166. doif tmvt va00 va01 eq 1
  167. * move to a healthy carrot position
  168. mvto va00 va01
  169. * or, if the saved position is not valid
  170. else
  171. * move to a nearby valid position
  172. mvsf va00 va01
  173. endi
  174. setv ov61 20
  175. * set 4 mins timer
  176. tick 1200
  177. * target healthy carrot again, since we've been dealing with detritus
  178. targ ownr
  179. doif prop room targ 2 le 0.2
  180. * carrot in the ground
  181. pose 0
  182. * stop motion
  183. velo 0 0
  184. * no timer (remember in the 'drop' script, there is a doif tick 0?)
  185. tick 0
  186.  
  187.  
  188. * I guess what's happening here is the carrot is checking how much nutrients are in the room?
  189. * and if there's enough, instead of killing the carrot when it rots, it just re-plants the carrot and pretends it's new
  190. * but I see no way for the carrot to know its timer is 0 unless the drop script is activated???
  191.  
  192.  
  193. * if there's not enough "property #3" here
  194. else
  195. * KILL CARROT
  196. kill ownr
  197. endi
  198. * if there's not enough "property #2" and "property #4" here
  199. else
  200. * KILL CARROT
  201. kill ownr
  202. endi
  203. * and now we are left with a rotting detritus carrot in its place
  204. endm
  205.  
  206.  
  207. * carrot eat script
  208. scrp 2 11 14879 12
  209. snde "chwp"
  210. * add coldness and coldness back up drive effects, to benefit cold-loving creatures only!
  211. targ from
  212. driv 152 0.3
  213. driv 135 0.3
  214. targ ownr
  215. * temp variable to save X pos
  216. setv va00 posl
  217. * temp variable to save X pos
  218. setv va01 post
  219. * eaten food stimuli
  220. stim writ from 79 1
  221. * 10-tick delay
  222. wait 10
  223. inst
  224.  
  225. setv va02 rand 0 1
  226. mulv va02 4
  227. * can be either 10 or 14
  228. addv va02 10
  229.  
  230.  
  231. * in carr.c16, image #10 is eaten facing right, image #14 is eaten facing left
  232.  
  233.  
  234. * turn randomly-facing, half-eaten carrot into detritus
  235. new: simp 2 10 14879 "needlcarr" 4 va02 5001
  236. accg 5
  237. aero 20
  238. attr 195
  239. bhvr 48
  240. elas 0
  241. setv ov61 10
  242. * move left a tiny bit
  243. subv va01 20
  244. * are the saved coords valid?
  245. doif tmvt va00 va01 eq 1
  246. * move there
  247. mvto va00 va01
  248. * or, if they are not valid
  249. else
  250. * find a nearby position and move there
  251. mvsf va00 va01
  252. endi
  253. * set 1 min timer
  254. tick 300
  255. * KILL THE CARROT, only detritus exists now
  256. kill ownr
  257. endm
  258.  
  259.  
  260. * detritus timer script
  261. scrp 2 10 14879 9
  262. doif carr eq null and fall eq 0
  263. doif pose lt 3
  264.  
  265.  
  266. * remember, in carr.c16, detritus images are 2,3,4,5 (uneaten, right) or 6,7,8,9 (uneaten, left)
  267. * pose counts from 0, so 3 is actually image #5, aka the final stage of rotting away
  268. * in other words, do if we're still in the process of rotting
  269.  
  270.  
  271. * temp var set to current stage of rot
  272. setv va00 pose
  273. * increase stage of rot by 1
  274. addv va00 1
  275. * set the pose
  276. pose va00
  277. inst
  278. * if carrot exists in a valid room and am not being carried
  279. doif room targ ne -1 and carr eq null
  280. * does this mean add nutrients or smell?
  281. altr room targ 4 0.01
  282. altr room targ 3 0.01
  283. endi
  284. slow
  285. * otherwise, we're fully rotted, time to disappear
  286. else
  287. inst
  288. doif room targ ne -1 and carr eq null
  289. altr room targ 4 0.01
  290. altr room targ 3 0.01
  291. endi
  292. slow
  293. * temp pos X
  294. setv va00 posl
  295. * temp pos Y
  296. setv va01 post
  297. inst
  298. * do if the room's conditions are right: check heat CA
  299. doif prop room targ 2 le 0.2
  300.  
  301. * spawn new healthy carrot!
  302. new: simp 2 11 14879 "needlcarr" 7 0 50
  303. attr 199
  304. accg 5
  305. * I guess it flings the new carrot a few pixels away?
  306. aero 20
  307.  
  308. bhvr 48
  309. elas 0
  310. doif tmvt va00 va01 eq 1
  311. * move to the location
  312. mvto va00 va01
  313. * or, if that position isn't valid
  314. else
  315. * move to a nearby location
  316. mvsf va00 va01
  317. endi
  318. * stop moving
  319.  
  320. velo 0 0
  321. setv ov61 60
  322. * it smells like food
  323. emit 8 0.5
  324. endi
  325. endi
  326.  
  327.  
  328. * KILLLLLLL ITTTTTTTT
  329. kill ownr
  330. endi
  331. endm
  332.  
  333.  
  334. * detritus eaten script
  335. scrp 2 10 14879 12
  336. lock
  337. targ from
  338. * I have eaten detritus (ew!)
  339. stim writ from 81 1
  340. * small trace of alcohol for toxic breeds
  341. chem 75 0.05
  342. * 10-tick delay
  343. wait 10
  344. * KILL THE MOULDY CARROT (okay, it was eaten)
  345. kill ownr
  346. endm
  347.  
  348.  
  349. * remove script
  350. rscr
  351. enum 2 11 14879
  352. * kill all carrots
  353. kill targ
  354. next
  355. enum 2 10 14879
  356. * kill all detritus carrots
  357. kill targ
  358. next
  359. * don't know what '2 10 14879 90' is, but it was in the original c3 carrot remove script?
  360. scrx 2 10 14879 90
  361. scrx 2 11 14879 4
  362. scrx 2 11 14879 6
  363. scrx 2 10 14879 6
  364. scrx 2 11 14879 5
  365. scrx 2 11 14879 9
  366. scrx 2 11 14879 12
  367. scrx 2 10 14879 9
  368. scrx 2 10 14879 12
Advertisement
Add Comment
Please, Sign In to add comment