Table of Contents

Scripts > Add custom volcano

Description Add a custom volcano to the heightfield, with user-defined radius, height &c.
Author Aaron
Created 2010/05/24
Updated 2010/05/24
Requires L3DT v2.9 beta 2 or later
Download add custom volcano.zs

Script contents

// exit immediately if HF is not initialised
hvar pHF
set pHF <GetMap "HF">
assert <map.GetWidth pHF> "Heightfield is not initialised!"

// initiailise the settings
int ls.xpos
int ls.ypos
int ls.BaseRadius
int ls.RimRadius
int ls.CoreRadius
float ls.RimHeight
float ls.CoreDepth

set ls.xpos 0
set ls.ypos 0
set ls.BaseRadius 240
set ls.RimRadius 24
set ls.CoreRadius 12
set ls.RimHeight 400
set ls.CoreDepth -150

// edit settings UI, and exit if cancelled
assert <EditUI &ls "Enter volcano settings"> "Calculation aborted"

// store a backup
L3DTio_Backup.ExtBackupMap "HF" "Apply volcano to HF" 0 "view.ShowMap \"HF\""

// apply the volcano
calc.HF.VolcanoOverlay pHF ls.xpos ls.ypos ls.BaseRadius ls.RimRadius ls.CoreRadius ls.RimHeight ls.CoreDepth

// refresh the heightfield
view.ShowMap "HF"

Comments

None.