creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Improving the headball   
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  4/7/2020

So I had an idea for improving Masha's headball - in that it would use the original head sprites for the creatures to allow a variety of heads to be used. So far, this is what I've got.

inst
loop
*(the first a for the head, the other 3 are placeholders that'll get changed)
sets va00 "aaaa"
*(selects a random SYMBOL from 0 to 7 according to the ascii table and puts it into the second place of va00)
char va00 2 rand 48 55
*(same thing for the SYMBOLS 0 to 6 to select a random life stage)
char va00 3 rand 48 54
*(selects a random letter a to z and puts it in 4th place, for a randomized breed slot)
char va00 4 rand 97 122
untl snax va00 = 1
new: simp 2 21 2000 "va00" 191 0 1000
attr 199
*act1, act2, hit, pickup
bhvr 43
elas 70
aero 3
accg 2
perm 60
fric 100
tick rand 20 80
sets ov00 "normal"

* get creator positioning
setv va01 game "CreatorX"
setv va02 game "CreatorY"
* if no values then assume this is C3 only
doif va01 eq 0 and va02 eq 0
* move it to a safe C3 location (just above the incubator area)
setv va01 rand 1400 1550
setv va02 400
endi

mvsf va01 va02

**act1
scrp 2 21 2000 1
stim writ from 97 1
velo rand -20 20 -20
endm

**act2
scrp 2 21 2000 2
stim writ from 97 1
velo rand -20 20 -20
endm

**hit
scrp 2 21 2000 3
stim writ from 97 1
velo rand -20 20 -20
endm

**pickup
scrp 2 21 2000 4
inst
sets ov00 "happy"
base 41
sndc "gig2"
stim writ from 97 1
endm

**timer
scrp 2 21 2000 9
anim [0 1 0]
doif fall eq 0 and ov00 ne "normal"
sets ov00 "normal"
base 0
pose 0
endi
endm

**collision
scrp 2 21 2000 6
inst
doif ov00 eq "normal"
base 9
sets ov00 "shocked"
sndc "ow!2"
elif ov00 eq "happy"
base 41
sets ov00 "shocked"
sndc "ow!2"
elif ov00 eq "shocked"
base 137
sets ov00 "angry"
sndc "ow!1"
elif ov00 eq "angry"
base 105
sets ov00 "miffed"
sndc "ow!3"
elif ov00 eq "miffed"
base 73
sets ov00 "down"
endi
pose 9
endm


*REMOVAL
rscr
enum 2 21 2000
kill targ
next


I'm not sure how to code in a blink or how to use all the different facial expressions on offer.


My TCR Norns
 
Vermidia

Vermidia



  4/8/2020

For blinking, you can use the timer script to pose 16 due to the fact your setting the facial expression as the base, either randomly like this
doif rand 1 5 eq 5
pose 16
else
pose 0
endi

or based on a certain amount of ticks going by
doif ov00 ge 5
pose 16
setv ov00 0
else
pose 0
endi
addv ov00 1

I think there are only 6 facial expressions so your current collision code almost covers them all, your missing a base 169 for tired, but that's all.

Also you don't need to surround va00 in "" since it's already a string.


You know...wait...nevermind.
 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
1 online
Namiraja
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki