Volcano Question

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
Frost and Flame ruins are almost finished, but I had a couple questions about setting up something in particular for the end part of my map.

The last area is a large circular room that I want to have a functional volcano in the center surrounded by a small pool of lava. The volcano should have a delay of about 5 to 10 seconds where it will toggle between its "on" and "off" state, shooting out gouts of flame appropriately. (Sorta like the Volcano that is switch activated on Calruin2)

The volcano is considered an NPC as far as I know, how can I set this entity up for my map? And what are it's appropriate NPC name(s) to have this function? The Volcano will "die" once the monsters in the room have all been slain, and the treasure will appear.

If anyone could help it'd be greatly appreciated.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Well, there's the ancient traps/volcano, but it probably won't work very well, and looking it over, I think the NPCs may try to attack it, plus it looks like it's using the old laggy volcano system. Dun think anyone's ever used it.

Alternatively I could script up a new one - provide a map source, maybe leaving a cone as a placeholder, and I may even be able to scale it to the desired size.

Other alternative would be to use an env_model of the volcano, scale to desired size (mind, won't work in preview), or build one with brushes and fx yourself, and then use traps/quake with the addparam "volcanic" - that'll get you your flaming falling rock effect and all (also ;set_aoe;<room_radius>;set_noslow;set_dur;9999). Might only work in the alpha pack - think that feature's a bit new. When you want it to end, killtarget the related monster spawner. Plus side is that the projectiles won't get into trouble if the ceiling is too low or oddly shaped, or what not. Flaming rocks will just automatically fall from the ceiling now and again, along with a quake and falling debris effect. Damage and DOT scales with MaxHP.

You can also rig the volcano to erupt periodically with it, by changing set_dur;10.0 or what not, and just trigger a new one to spawn whenever you want it to erupt (maybe via a self-targeting multi-threaded multi_manager you eventually kill.)

Ya gonna finish Dungeoncrawl? It's sitting half finished in the alpha pack too.
 

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
Awesome, all very helpful tips so now I at least have an idea of what I'm working with lol. As for Dungeoncrawl, it's preeetty much done. I haven't added in the skyboxes for the outdoor area yet, finished detailing it, and finally filling it with monster(s) and other entities. I've stacked together a .rar with the two map resource files. I've started mostly focusing on FrostandFlame because it was inspired by a brief period of creative thinking and found working on Dungeoncrawl to be a bit boring. This doesn't mean however I've totally given up on it, though. ;)

I left a small volcano model placeholder on the area I'd like it to be located. Hopefully the VIS groups will render properly for you on FrostandFlame because I took great care to make sure it wasn't sloppy or as unorganized, as I feel Dungeoncrawl is.

Frost and Flame more than likely is going to be re-textured, I fear, due to a lot of critique about the smaller resolution of the texture choices. Shouldn't be much of an issue though since it's not that hard to do, but I haven't found any real good "snowy" kind of stone textures I can use, or "hot" stone, either.

Dungeoncrawl you will start inside of the new town area that has been added, eventually working your way into the entrance of the Dungeon below. The map is sorta aiming for a long playthru that Bloodrose inspires. (Minus the crappy boss room and crystals) ;)

I might even add a transition for the two maps, Frost and Flame being the lower portion of the Dungeon hidden away, which is where the true final battle will occur with the wicked avatar, Hyperion, which they battled earlier in the Dungeon.

Anywho, rambling aside, if you have any map progression questions, just let me know. There is possible to be a few stray ms_player_spawn entities randomly floating about, as I constantly use them for scale. :D
 

Attachments

  • DungeonCrawl34b_FrostFlame22b.rar
    2 MB · Views: 6

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Oh dear... Got a working current version of Jack Hammer I can download? Seems my old one doesn't like this, and the current Windows download is bjorked.

edit: Nevermind, found one at ModDb.

(Opens map...)

Yeeeah... This ceiling is very low. Either you'd have to raise it, a LOT, or you'd have to go with the traps/quake method. There's no way to arc projectiles from this thing and have them land anywhere a player might be standing. If you cast a volcano down in there yourself, you'll probably find all the projectiles hit the ceiling.
 

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
I'm aware of the ceiling, didn't plan on keeping it that way due to the obvious problem of headroom in addition to having the thing erupt. Map still has a ways to go. ;)

Entity work will be the tricky thing, any suggestions for a good height? 512 units or so?

I feel like the map already is pushing its limits in size. Takes a bloody long time to compile, too, even without the RAD stage.

I've ALSO tried to snap some ingame shots of it but it kept crashing due to incomplete entity work. (solid brushes with an AA trigger texture face.)

But besides that there are no issues whatsoever with compiling. Been too lazy to correct it to follow up with the screenies though. :p
 

MS:C community

Old Skool Apostle
Alpha Tester
Joined
Jul 7, 2011
Messages
500
Reaction score
107
Other alternative would be to use an env_model of the volcano, scale to desired size (mind, won't work in preview)
J.A.C.K. previews scaled models no problem. You can even use Alt + drag* to scale a model.
See this video and then switch to J.A.C.K.

*Should be enabled per default, otherwise see Tools --> Options... --> General
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Entity work will be the tricky thing, any suggestions for a good height? 512 units or so?
Yeah, 512 would be safe... 384 at least, assuming you want to keep the volcano this size. Currently it's <128. I suppose you could replace it with a rotating flame thrower msarea_scripted brush, that just shoots right at the player height in a circle. Otherwise I'd rip the ceiling right off and make it a sky brush way up high.

There doesn't seem to be a way out of the moat around it, which is a bit cruel - but your maps are full of sadistic traps, so I guess that's intentional. Might take the volcano a long time to kill someone trapped in there - though maybe not so long that they could summon-stack their way out.

J.A.C.K. previews scaled models no problem. You can even use Alt + drag* to scale a model.
See this video and then switch to J.A.C.K.
Can fiddle with that, but I'd need to be able to give it a number to match the scale factor in the env_model stats. (Oh, nvm, it's smart enough to detect the scale setting, sweet.) Seems, given the size of the room, we might not want to make it much bigger, less the intent is to fill the whole center platform and force the players to rush around the sides.

volcanoroom.png
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Here's my quick solution to the problem...

volcanoroom_fix.png

Download the attached rar and see if it fits your aesthetic (not leak tested, but looks good - had to shimmy with a wall that was protruding due to the way the inlet worked). I hid the rest of the map.

I'll have to work up a script for it (current placeholder is traps/volcano_shooter). It'll probably need to be a little fancier than the regular volcano effect, due to the size, and I'll add a big red light to the cleffects, so you won't have to worry about placing a dynamic light here.

Ya shouldn't have to worry about this, but the way the old volcano tossed projectiles was extremely laggy. The solution was to change it over to client side projectiles, but as this volcano is map generated, it's a bit difficult to determine which client to use in order to track the projectiles. I suppose I can rig it up to just periodically choose whichever player is closest, but it does mean if no players are on the map, the projectiles won't spawn (no biggie, I suppose).

You may also want to make the mote floor lava.

PS. Do you want the projectiles to be capable of damaging NPCs?
 

Attachments

  • volcanoroom_fix.rar
    312 KB · Views: 1

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
There doesn't seem to be a way out of the moat around it, which is a bit cruel - but your maps are full of sadistic traps, so I guess that's intentional.

LOOOL, I dunno why but this got me for some reason, haha. I'll add a couple small ladders to make it a bit nicer for folks to get out of the pit. (if they are unfortunate enough to get tossed in there by the Fire Beasts or Skeleton Minions.)

This volcano and room are amazing! Thank you a ton, at this point any little bit of help (or in this case a lot of help) definitely speeds things up and makes things much easier. :D

The monsters that will be in this area will all be Fire themed minions appropriately, so no need to have it damage the monsters escorting it. Not that fire could hurt an Undead Firegiant or Lava Boar anywho. ;)
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Hrmm... This rim around the volcano may not offer enough room for such beasts. I was thinking maybe you were using flaming horrors or something.

Not done with the script yet, but I've rigged it so you can change its race (defaults to "hated" which means it can attack NPCs). Should probably change its race to whatever the local fauna are using, as even if they are fire immune, it'll waste resources trying to set them on fire.
 

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
I put a func_monsterclip over the pit so they should have no trouble navigating in the room (hopefully.) They may look a bit silly being able to "fly" over the lava but it's possible I could add in a fancy glowing barrier to go with it, that doesn't affect players at all, and would give the illusion the minions are at least standing on something.
 

Kanta

Old Skool Apostle
Alpha Tester
Joined
Jan 24, 2013
Messages
634
Reaction score
85
Location
ms_swamp
You could make the enemies glow with red light and put something see-through over the lava to give the illusion of them walking over some kind of barrier, or just the lava itself. It might not be very fun if they camped right on top of the ladders to get out though. Also maybe the lava should deal fire damage instead of the direct damage, akin to the freezing tundra water? I always liked this effect for environmental hazards. Don't go hugging the trees in the haunted forest!
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
To get that effect, use a triger_multiple instead of a trigger_hurt, and fill out the scriptevent property with "trig_damage;Lava;200;fire_effect" (sans quotes - adjust 200 damage entry to your choosing). Also reduce the delay on the trigger_multiple, as I think it defaults to 10 seconds - that might be a Sarlacc tier slow death.
 

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
I have tried to compile the map with no problems besides some kind of error "SolidBSP [hull 1] 500...Warning: Ambiguous leafnode content ( EMPTY and SOLID ) at (1736,-1648,20)-(1824,-1552,28) in hull 1 of model 0 (entity: classname "worldspawn", origin "", targetname "")

I traced the coordinates and can't for the life of me figure out why the compiled map just crashes every time I try to load it on a test server..? :wha:

I'm utterly confused as I'm almost 100% sure I've fixed all the entities that could cause this. I'm stumped at this and I don't really even know what the hell that error means even after google searching for it.

Any advice? New version of the map provided in the rar that has implemented your Volcano room changes. Not only that but I have included the compile log as well. I also edited out the placeholder script and made sure to edit my "worldspawn" entity properly as well.

This is beyond frustrating trying to figure out whatever the hell is causing this.

EDIT: Whoops, forgot to upload the rar, fixed.
 

Attachments

  • frostandflame26b.rar
    636.9 KB · Views: 3
Last edited:

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Generally a few ambiguous leafnode content warnings can be ignored in vhlt - it's picky.

Well, I don't have the texture "BLACK_HIDDEN", so I substituted with "BLACK".

Your log suggests you have not used -nowadtextures -wadautodetect, which would cause a crash if a .wad file isn't in the root.

I don't have sprite/effects/snowflake.spr - which is fatal.

Ya didn't provide a BSP, but my compile params are:
Code:
vhlcsg_x64 -low -chart -nowadtextures -wadautodetect
vhlbsp_x64 -low -chart
vhlvis_x64 -low -estimate -chart -full
vhlrad_x64 -low -chart -threads 3 -estimate -extra -lights "lights.rad"
(ya can skip the -low, -chart, -estimate, and -threads 3 params.)

Compile time was 37 seconds.

Looks fine in BSPview - though the lighting seems a bit uniform. Can't load it in game with missing media though - I'd just replace the sprite, but IDK how much more I'm missing.
 

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
Thank you! The stupid missing env_sprite was making the map crash. :/ Seemed to have lost that one when I did a reinstall of MS:C awhile ago. At least now I can look around on my own map lol. Screenshots coming up shortly. :oldrazz:
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
When running full screen, sometimes pop-up alerts get lost behind the window, so if something crashes, alt-tab, look at the task bar, and see if there's another message for hl.exe. (Also think the log_msdll.log would catch that one).

Granted, come next patch, due to the issues pop-ups cause with dedicated servers, probably going to rig it to eliminate as many as possible by killing the msgbox function, in which case the .log would be your only hope. (Though maybe we can rig it so it keeps pop-ups for listenservers.)
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Seems I got something to show off a bit before you did:

http://www.thothie.com/msc_dev4/volc_test.webm

Doesn't hit real often - you can use dmgmulti to up the damage though - I could increase the blast radius of the rocks, and maybe make the splodie sprite reflect that, however. I suppose I *could* do the math and try to make it land rocks within a certain range of the volcano more often, but I've not played Scorched Earth in awhile.

If you jump on the volcano, it'll treat it as if you were hit by a rock every second.

Unlike the volcano spell, the rocks cannot be blocked by standing on it, as they only collide with world brushes.

I'll have the DLLs for that PM'd in a bit. I'd have you use test_scripts, but rumor has it that client effects are not working for test_scripts.

Adds 1 sprite precache to your map.

Gonna post the scripts here for the curious - do suggests reading the first few comment lines for usage, example above is using defaults:

traps/volcano_shooter
Code:
#scope server

//Volcano shooter by Thothie - intended for placement on top of a map generated volcano cone or other fire spewing object.
//- Defaults to infinite duration (shoots until spawner is deleted), use set_dur;<secs> to change.
//- DOT and AOE damage scales with MaxHP, but you may use dmgmulti to increase/decrease.
//- Projectiles are client side - if there are no clients to attach the script to, projectiles will not spawn.
//- If there are no players present, volcano will continue scanning for players until there are.
//- Volcano will switch client used for determining projectile collisions every 5 seconds, favoring the closest.
//
//optional add params:
//set_race;<race> - defaults to hated (can damage NPCs)
//set_dur;<secs> - duration until removed (defaults infinite)
//set_nolight - disables lighting effects
//set_rad;<radius> - volcano radius, used to determine force of projectiles and light radius. Defaults to 384 - may become unreliable at much larger/smaller radii.

{
	setvard VOLC_DURATION -1
	setvard VOLC_NOLIGHT 0
	setvard VOLC_RAD 384

	const FREQ_CLFX_REFRESH 60.0
	const FREQ_PULSE 1.0
	const FREQ_SHAKE 20.0
	setvard FREQ_UPDATE_CL_TRACKER 5.0

	const SOUND_VOLC_START magic/volcano_start.wav
	const SOUND_VOLC_LOOP magic/volcano_loop.wav

	const BOMB_RAD 64 //aoe of projectiles

	//ratio of maxhp to adjust damage to
	const DMG_AOE_RATIO 0.3 //this is resistable, so for more players it's gonna come back as half this, for max char comes back ~60/tic
	const DMG_DOT_RATIO 0.05 //DOT is not resistable (save via fire resistance), for max char this comes back ~22/tic
}

{ game_precache
	precache fexplo1.spr
	precache rjet1.spr
	svplaysound 0 0 SOUND_VOLC_LOOP
}

#include [server] monsters/base_addparams
#include [server] debug //%% remove

{ game_spawn
	name a|Volcano
	setmodel null.mdl //required for origin
	race hated
	invincible 1
	nopush 1
	gravity 0
	setvard PLAYING_DEAD 1
	setsolid none
	setprop ent_me movetype 0

	callevent 0.5 volc_start
}

{ game_postspawn //PARAM1 = (name|default), PARAM2 = DmgMulti, PARAM3 = HPMulti, PARAM4 = pass_params

	if ( PARAM1 isnot 'default' )
	{
		name PARAM1
	}

	if PARAM2 > 0
	dmgmulti PARAM2
}

//==================== Add Params [begin]
{ set_race
	if PARAM1 !startswith PARAM
	race PARAM1
}

{ set_dur
	if PARAM1 !startswith PARAM
	setvard VOLC_DURATION PARAM1
}

{ set_nolight
	setvard VOLC_NOLIGHT 1
}

{ set_rad
	if PARAM1 !startswith PARAM
	setvard VOLC_RAD PARAM1
}
//==================== Add Params [end]

{ game_deleted
	callevent game_death
}

{ game_death
	if !VOLC_DID_DEATH
	setvard VOLC_DID_DEATH 1
	setvard VOLC_ACTIVE 0
	callevent volc_clfx_remove
}

{ volc_start
	callevent volc_get_cl_tracker
	if ( $get(VOLC_CL_TRACKER,isplayer) )
	{
		setvard VOLC_ACTIVE 1
		callevent volc_refresh_clfx
	}
	else
	{
		callevent 1.0 volc_start
		exitevent
	}
	callevent FREQ_UPDATE_CL_TRACKER volc_update_cl_tracker
	callevent FREQ_PULSE volc_pulse

	if ( VOLC_DURATION > -1 ) callevent VOLC_DURATION volc_end

	playsound 1 10 SOUND_VOLC_START
}

{ volc_refresh_clfx
	if VOLC_ACTIVE
	if ( VOLC_CLFX_IDX isnot 'VOLC_CLFX_IDX' )
	{
		callevent volc_clfx_remove
	}
	clientevent new all traps/volcano_shooter_cl $get(ent_me,index) $get(VOLC_CL_TRACKER,index) VOLC_RAD VOLC_NOLIGHT FREQ_CLFX_REFRESH
	setvard VOLC_CLFX_IDX game.script.last_sent_id
	svplaysound 2 10 SOUND_VOLC_LOOP
	callevent FREQ_CLFX_REFRESH volc_refresh_clfx
}

{ volc_clfx_remove
	svplaysound 2 0 SOUND_VOLC_LOOP
	clientevent update all VOLC_CLFX_IDX end_fx
}

{ volc_get_cl_tracker
	setvard VOLC_CL_TRACKER unset
	if game.players > 0
	getplayers PLAYER_LIST
	setvard PLAYER_LIST $sort_entlist(PLAYER_LIST,range)
	setvard VOLC_CL_TRACKER $get_token(PLAYER_LIST,0)
}

{ volc_update_cl_tracker
	if VOLC_ACTIVE
	callevent FREQ_UPDATE_CL_TRACKER volc_update_cl_tracker
	
	callevent volc_get_cl_tracker
	if ( VOLC_CL_TRACKER equals unset )
	{
		setvard FREQ_UPDATE_CL_TRACKER 0.5
	}
	else
	{
		setvard FREQ_UPDATE_CL_TRACKER 5.0
		clientevent update all VOLC_CLFX_IDX sv_update_tracker $get(VOLC_CL_TRACKER,index)
	}
}

{ volc_pulse
	if VOLC_ACTIVE
	callevent FREQ_PULSE volc_pulse
	//burn things near me with the same effect I use for projectiles
	//<target|(src_origin)> <range|aoe|(dest_origin)|direct> <damage> <cth|fall_off> <attacker> <inflciter> <skill|none> <dmg_type> [flag_string]
	xdodamage $get(ent_me,origin) $math(multiply,VOLC_RAD,0.5) 100 0.01 ent_me ent_me none fire_effect dmgevent:bomb

	if G_DEVELOPER_MODE
	callevent ext_debug_draw_circle $get(ent_me,origin) $math(multiply,VOLC_RAD,0.5) 0.5
}

{ ext_bomb_land //<origin> - called from game_master->gm_ce_pass_back via cleffect event
	//projectile landed, damage/burn things around it
	//dbg ext_bomb_land PARAM1 PARAM2
	local L_POS PARAM1
	local L_GROUND L_POS
	vectorset L_GROUND z $get_ground_height(L_GROUND)

	if ( $dist(L_POS,L_GROUND) < 72 ) local L_POS L_GROUND //snap to ground, if close
	xdodamage L_POS BOMB_RAD 100 0 ent_me ent_me none fire_effect dmgevent:bomb
	if G_DEVELOPER_MODE
	callevent ext_debug_draw_circle L_POS BOMB_RAD 0.5
}

{ game_damaged_other //PARAM1=target_hit PARAM2=dmg PARAM3=dmg_type PARAM4=dmgevent
	if PARAM4 equals bomb

	if $get(PARAM1,relationship,ent_me) equals enemy

	local L_DMG PARAM2
	local L_TARG_MAXHP $get(PARAM1,maxhp)
	local L_NEW_DMG $math(multiply,L_TARG_MAXHP,DMG_AOE_RATIO)

	local L_DOT $math(multiply,L_TARG_MAXHP,DMG_DOT_RATIO)
	applyeffect PARAM1 effects/effect_burn 5.0 $get(ent_me,id) L_DOT

	//dbg game_damaged_other outdmg L_NEW_DMG $math(divide,L_DMG,L_NEW_DMG)

	setdmg dmg L_NEW_DMG
	//returndata $math(divide,L_DMG,L_NEW_DMG)
}

{ ext_monsterspawn_removed
	if $get(ent_me,spawner) equals PARAM1
	callevent volc_end
}

{ volc_end
	race hated
	invincible 0
	dodamage ent_me direct 99999 100 GAME_MASTER target
}

//========== Debuggary
{ ext_debug_draw_circle //<origin> <rad> [dur] [col]
	setvard DBG_CIRCLE_POS PARAM1
	setvard DBG_CIRCLE_RAD PARAM2
	setvard DBG_CIRCLE_ROT 0
	setvard DBG_CIRCLE_COLOR (255,0,255)
	setvard DBG_CIRCLE_DUR 20.0

	if ( PARAM3 !startswith PARAM ) setvard DBG_CIRCLE_DUR PARAM3
	if ( PARAM4 !startswith PARAM ) setvard DBG_CIRCLE_COLOR PARAM4

	local L_BEAM_START $math(vectoradd,DBG_CIRCLE_POS,z,DBG_CIRCLE_RAD)
	local L_BEAM_END $math(vectoradd,DBG_CIRCLE_POS,z,$neg(DBG_CIRCLE_RAD))
	effect beam point lgtning.spr 20 L_BEAM_START L_BEAM_END DBG_CIRCLE_COLOR 200 0 DBG_CIRCLE_DUR
	
	calleventloop 16 ext_debug_draw_circle_loop
}

{ ext_debug_draw_circle_loop
	local L_BEAM_START DBG_CIRCLE_POS
	vectoradd L_BEAM_START $relpos($vec(0,DBG_CIRCLE_ROT,0),$vec(0,DBG_CIRCLE_RAD,0))
	add DBG_CIRCLE_ROT 22.5

	local L_BEAM_END DBG_CIRCLE_POS
	vectoradd L_BEAM_END $relpos($vec(0,DBG_CIRCLE_ROT,0),$vec(0,DBG_CIRCLE_RAD,0))

	effect beam point lgtning.spr 20 L_BEAM_START L_BEAM_END DBG_CIRCLE_COLOR 200 0 DBG_CIRCLE_DUR
}

traps/volcano_shooter_cl (client bits)
Code:
{
	const ROCK_LIGHT_RAD 64

	const SPRITE_ROCK_EXPLODE fexplo1.spr
	const SPRITE_SPIT_FIRE rjet1.spr
}

{ client_activate //<owner> <client_tracker> <radius> <nolight> <duration>
	setvard FX_OWNER PARAM1
	setvard FX_ORG $getcl(PARAM1,origin)
	setvard FX_CLTRACK_IDX PARAM2
	setvard FX_RAD PARAM3
	local L_NO_LIGHT PARAM4
	setvard FX_DURATION PARAM5

	dbg *** $currentscript own FX_OWNER cl FX_CLTRACK_IDX rad FX_RAD nolight L_NO_LIGHT dur FX_DURATION

	if ( !L_NO_LIGHT )
	{
		cleffect light new FX_ORG FX_RAD (255,0,0) FX_DURATION
		setvard FX_MAIN_LIGHT game.script.last_light_id
	}

	setvard FX_ACTIVE 1

	setvard FX_ROCK_VEL 500
	multiply FX_ROCK_VEL $math(divide,384,FX_RAD) //increase or decrease proj velocity based on radius

	callevent fx_loop
	callevent FX_DURATION end_fx
}

{ end_fx
	if ( FX_ACTIVE )
	{
		cleffect light FX_MAIN_LIGHT FX_ORG 0.1 (0,0,0) 0.1
		callevent 3.0 remove_fx
	}
	setvard FX_ACTIVE 0
}

{ remove_fx
	removescript
}

{ sv_update_tracker
	setvard FX_CLTRACK_IDX PARAM1
}

{ fx_loop
	if FX_ACTIVE
	callevent 0.1 fx_loop

	cleffect tempent model weapons/projectiles.mdl FX_ORG setup_volc_rock update_volc_rock collide_volc_rock
	calleventloop 4 fx_spit_fire
}

{ fx_spit_fire
	cleffect tempent sprite SPRITE_SPIT_FIRE FX_ORG setup_volc_spit
}

{ setup_volc_spit

	local L_X $randf(-50,-140)
	local L_Y $randf(-180,180)
	local L_ANGS $vec(L_X,L_Y,0)

	local L_SPIT_FVEL $math(multiply,FX_ROCK_VEL,0.5)
	local L_SPIT_VEL $relvel(L_ANGS,$vec(0,L_SPIT_FVEL,0))
	local L_SPIT_GRAVITY $randf(0.8,1.4)

	cleffect tempent set_current_prop death_delay 3
	cleffect tempent set_current_prop velocity L_SPIT_VEL
	cleffect tempent set_current_prop bouncefactor 	0
	cleffect tempent set_current_prop gravity L_SPIT_GRAVITY
	cleffect tempent set_current_prop collide world;die

	cleffect tempent set_current_prop framerate 30
	cleffect tempent set_current_prop frames 5
	cleffect tempent set_current_prop renderfx add
	cleffect tempent set_current_prop renderamt 255
}

{ setup_volc_rock

	local L_X $randf(-50,-140)
	local L_Y $randf(-180,180)
	local L_ANGS $vec(L_X,L_Y,0)

	setvard L_ROCK_VEL $relvel(L_ANGS,$vec(0,FX_ROCK_VEL,0)) 
	setvard L_ROCK_GRAVITY $randf(0.6,1.2)

	cleffect tempent set_current_prop death_delay 10
	cleffect tempent set_current_prop velocity L_ROCK_VEL
	cleffect tempent set_current_prop bouncefactor 	0
	cleffect tempent set_current_prop gravity L_ROCK_GRAVITY
	cleffect tempent set_current_prop collide world;die

	cleffect tempent set_current_prop framerate 1.0
	cleffect tempent set_current_prop frames 16
	cleffect tempent set_current_prop sequence 2

	cleffect tempent set_current_prop renderfx glow //unlike rendermode glow, this makes a glow shell
	cleffect tempent set_current_prop renderamt 100
	cleffect tempent set_current_prop rendercolor (255,0,0)

	local L_ORG game.tempent.origin
	cleffect light new L_ORG 64 (255,0,0) 0.5
	cleffect tempent set_current_prop iuser1 game.script.last_light_id
	cleffect tempent set_current_prop fuser1 game.time
	cleffect tempent set_current_prop fuser2 $vec.x(L_ORG)
	cleffect tempent set_current_prop fuser3 $vec.y(L_ORG)
	cleffect tempent set_current_prop fuser4 $vec.z(L_ORG)
}

{ update_volc_rock
	local L_ORG game.tempent.origin

	cleffect light game.tempent.iuser1 L_ORG 64 (255,0,0) 0.5

	//track old position
	//tempents do have a vuser1-4 property, but seems to be in use, and would need new code func to pull/set
	local L_LAST_STORE_ORG game.tempent.fuser1
	if game.time > $math(add,L_LAST_STORE_ORG,0.1)
	cleffect tempent set_current_prop fuser1 game.time
	cleffect tempent set_current_prop fuser2 $vec.x(L_ORG)
	cleffect tempent set_current_prop fuser3 $vec.y(L_ORG)
	cleffect tempent set_current_prop fuser4 $vec.z(L_ORG)
}

{ collide_volc_rock

	if ( game.localplayer.index equals FX_CLTRACK_IDX )
	{
		if game.time > NEXT_CE_EVENT
		setvard NEXT_CE_EVENT $math(add,game.time,0.01) //just to make sure we don't spam too many ce events at once

		//back track a little bit, since I'm probably inside a brush now
		local L_ORG_X game.tempent.fuser2
		local L_ORG_Y game.tempent.fuser3
		local L_ORG_Z game.tempent.fuser4
		local L_ORG $vec(L_ORG_X,L_ORG_Y,L_ORG_Z)
		//local L_ORG game.tempent.origin
		
		sound.play3d fire.wav 10.0 L_ORG

		cleffect light new L_ORG 128 (255,32,32) 1.0 //bigger light at impact

		//this event is new in GM, and passes ext_bomb_land back to the server-side volcano
		cleffect ce GM gm_ce_pass_back FX_OWNER ext_bomb_land $quote(L_ORG) x
	}

	//this doesn't work - not that I expected it to, but copied from old volcano
	//does seem crucial for removing the bombs though (dunno why, but teleporting em off world does not work, really wish we had a tempent remove command)
	cleffect tempent set_current_prop sprite 	fire1_fixed.spr
	cleffect tempent set_current_prop rendermode 	add
	cleffect tempent set_current_prop renderamt 	255
	cleffect tempent set_current_prop death_delay 	1
	cleffect tempent set_current_prop scale 	0.5
	cleffect tempent set_current_prop collide 	all
	cleffect tempent set_current_prop framerate	30
	cleffect tempent set_current_prop frames	23

	cleffect tempent sprite SPRITE_ROCK_EXPLODE game.tempent.origin setup_rock_explode //make splodie at impact, since above doesn't cut it
}

{ setup_rock_explode
	cleffect tempent set_current_prop rendermode add
	cleffect tempent set_current_prop renderamt 255
	cleffect tempent set_current_prop death_delay last_frame
	cleffect tempent set_current_prop scale 1.0
	cleffect tempent set_current_prop collide none
	cleffect tempent set_current_prop framerate 19
	cleffect tempent set_current_prop frames 16
	cleffect tempent set_current_prop gravity 0
}
 

ultima

Adventurer
MSC Developer
Joined
Nov 23, 2016
Messages
31
Reaction score
8
It's literally perfect and exactly what I had in mind! I probably won't mess around with the damage multiplier due to the Volcano serving mostly as a nuisance and encouraging players to work on killing the boss as to have it dissipate as quickly as possible, but it's good to have that function to change regardless for possible future stuff. :wink:

Realistically, the Volcano itself isn't even much of a threat due to Fire Immunity being a thing, but for those without, it should be a decent hindrance. It's also come to my attention after messing around ingame with the map that some areas are painfully claustrophobic and cramped, unfortunately. Namely the starting Ice area, and the Fire room proceeding it.

I'll need to mess around with these areas a bit more and expand them so everything feels more fluid gameplay wise, and a pair of players can atleast pass one another through the hallways. Right now it's feeling more like a singleplayer map vs a multiplayer one.
 
Top