/-/S'pht-Translator-Active/-/


Random monster placement with pfhortran.
Posted By: goranDate: 7/23/02 12:30 p.m.

Random monster placement has finally arrived. It is possible to do it with pfhortran. You can see the code below.

The script does the following:
when you activate tag 1 a specific monster will go to
one of four polygons and then sleep. Fortunely all these polygons are inside zones that activate monsters with
triggers, so it doesn’t matter if he’s asleep as he will wake up when you step on the visible_monster trigger.

( you’re gonna taste some sneaky monsters in part 12

what a hell, that monster wasn’t there some minutes ago
you know you can move monsters to zones the player have allready
visited to really surprise him.

(not because I would do something like that ;)
--------------------------------------------------
# random monster placement
# written by Goran

_procedure init

# this is the monster that is going to hide
openmon: def -1

# the random variables
aa: def true
ab: def false
ac: def false
ad: def false

end

_procedure idle

# this procedure will loop all the time and cause one
# of aa,ab,ac,ad to be set true each 10 ticks.
block_start
set aa, false
set ab, true
block_end
wait_ticks 10

block_start
set ab, false
set ac, true
block_end
wait_ticks 10

block_start
set ac, false
set ad, true
block_end
wait_ticks 10

block_start
set ad, false
set aa, true
block_end
wait_ticks 10

end

_procedure tag_switch

# if tag 1 is activated the script will jump to hide
get_my_value tag
If_= tag, 1, hide
# if another tag has been activated the script will
# jump to abort
jump abort

hide:
# From here you will jump to placeone, placetwo etc
# dependent on which of aa,ab,ac,ad is set true.
if_= aa, true, placeone
if_= ab, true, placetwo
if_= ac, true, placethree
if_= ad, true, placefour
jump ghide

placeone:
#select the monster "openmon", which is a minor juggernaut
# in poly 343
monster_select openmon, minor_juggernaut, 343
# move it to poly 337
monster_move openmon, 337
# this will select the monster when he has arrived
po: wait_ticks 10
monster_select openmon, minor_juggernaut, 337
if_= openmon, -1, po
# then he is put to sleep
monster_sleep openmon
jump abort

placetwo:
# same as place one but with a different poly he is
# going to go to
monster_select openmon, minor_juggernaut, 343
monster_move openmon, 352
pt: wait_ticks 10
monster_select openmon, minor_juggernaut, 352
if_= openmon, -1, pt
monster_sleep openmon
jump abort

placethree:
# same as place one but with a different poly he is
# going to go to
monster_select openmon, minor_juggernaut, 343
monster_move openmon, 363
pth: wait_ticks 10
monster_select openmon, minor_juggernaut, 363
if_= openmon, -1, pth
monster_sleep openmon
jump abort

placefour:
# same as place one but with a different poly he is
# going to go to
monster_select openmon, minor_juggernaut, 343
monster_move openmon, 487
pf: wait_ticks 10
monster_select openmon, minor_juggernaut, 487
if_= openmon, -1, pf
monster_sleep openmon
jump abort

abort:

end



Problems? Suggestions? Comments? Email maintainer@bungie.org

Marathon's Story Forum is maintained with WebBBS 5.12.