Modifying entity spawnflags / keyvalues with a script file

Quote from josepezdj on December 18, 2012, 2:55 amRand0mnumbers made a couple of awesome video tutorials about vscripting (apart from another bunch of useful tutorials). I think they will be useful for you, check:
Rand0mnumbers made a couple of awesome video tutorials about vscripting (apart from another bunch of useful tutorials). I think they will be useful for you, check:
Quote from innocentive on December 18, 2012, 2:58 amThanks! Will check them out soon...
Thanks! Will check them out soon...
Quote from FelixGriffin on December 18, 2012, 4:31 pmTo find out what EntFire can do, you can read that entity's page on the VDC, that lists all inputs and outputs. Or create an entity of that type in Hammer and click HELP.
Just wondering...you do understand inputs and outputs, right? You learned those before you started VScripting?
To find out what EntFire can do, you can read that entity's page on the VDC, that lists all inputs and outputs. Or create an entity of that type in Hammer and click HELP.
Just wondering...you do understand inputs and outputs, right? You learned those before you started VScripting?
Quote from innocentive on December 18, 2012, 4:50 pmTotally ... I think I can say that I understand Hammer's IO System pretty well. The thing is that I want to change the launch direction of a trigger_catapult ingame according to the behaviour of the player. As far as I can see there is no way to do that with the IO of Hammer. True, I don't need to write directly into the KeyValues, I can do that with EntFire and I'm grateful for you pointing that out. It just took me quite long to find the correct action to feed Entfire with for the target. As far as I know there's no respective reference listing all actions you can fire for any given entity. I understand that Hammer and VDC don't list all KeyValues but maybe I'm wrong about that.
It would be so much more efficient if you could just access the KeyValues ... that's all.
Totally ... I think I can say that I understand Hammer's IO System pretty well. The thing is that I want to change the launch direction of a trigger_catapult ingame according to the behaviour of the player. As far as I can see there is no way to do that with the IO of Hammer. True, I don't need to write directly into the KeyValues, I can do that with EntFire and I'm grateful for you pointing that out. It just took me quite long to find the correct action to feed Entfire with for the target. As far as I know there's no respective reference listing all actions you can fire for any given entity. I understand that Hammer and VDC don't list all KeyValues but maybe I'm wrong about that.
It would be so much more efficient if you could just access the KeyValues ... that's all.
Quote from Brainstone on December 18, 2012, 5:23 pmGive your trigger_catapult the input setlaunchtarget <targetname>. Not listed anywhere, but actually works. Some guys on the forum found this out once. I stumbled upon it and used it. Works perfectly.
As launchtarget you can take preferably info_targets, but !player is possible, too. In my map (a bossfight), I parented a point_template to the player, which created static info_targets, which were then shot by bombss a short period of time afterwards.
Give your trigger_catapult the input setlaunchtarget <targetname>. Not listed anywhere, but actually works. Some guys on the forum found this out once. I stumbled upon it and used it. Works perfectly.
As launchtarget you can take preferably info_targets, but !player is possible, too. In my map (a bossfight), I parented a point_template to the player, which created static info_targets, which were then shot by bombss a short period of time afterwards.
Quote from FelixGriffin on December 18, 2012, 6:23 pmAh, okay. Just checking. And there is a list, as I said, on the VDC page for each entity. Anything EntFire does can be done with an output, so you can change KeyValues that way too.
Also, remember that the catapult only applies a force once. If bombs target the player, for example, the player can dodge, because it won't keep correcting them. This wrecked a big section of a map once when I didn't count on player movement.
Ah, okay. Just checking. And there is a list, as I said, on the VDC page for each entity. Anything EntFire does can be done with an output, so you can change KeyValues that way too.
Also, remember that the catapult only applies a force once. If bombs target the player, for example, the player can dodge, because it won't keep correcting them. This wrecked a big section of a map once when I didn't count on player movement.
Quote from innocentive on December 18, 2012, 7:20 pmI haven't found such list on VDC ... we're talking about developer.valvesoftware.com, right?
Let's just take the trigger_catapult as an example: when I check the corresponding page on VDC, I see multiple entries. Looking at the keyvalues of a trigger_catapult in Hammer will show quite a lot in SmartEdit but once you turn it off there's just about half of the keyvalues left. So this is where you start trying what would be the right key value combination to work with. On top of that, and not necessarily making things easier, there's the autocomplete of the ingame console on the ent_fire command. I've gone through the trouble of compiling the list of 'actions' the Portal 2 console offers for a trigger_catapult entity:
addcontext
addoutput
alpha
alternativesorting
callscriptfunction
clearcontext
clearparent
color
disable
disabledamageforces
disabledraw
disabledrawinfastreflection
disablereceivingflashlight
disableshadow
dispatchresponse
enable
enabledamageforces
enabledraw
enabledrawinfastreflection
enablereceivingflashlight
enableshadow
endtouch
fireuser1
fireuser2
fireuser3
fireuser4
kill
killhierarchy
removecontext
removepaint
runscriptcode
runscriptfile
setdamagefilter
setexactvelocitychoicetype
setlaunchtarget
setlocalangles
setlocalorigin
setparent
setparentattachment
setparentattachmentmainoffset
setphysicsspeed
setplayerspeed
setteam
starttouch
toggle
touchtest
useYou see that there are substantial differences between all 'lists' either on VDC or in Hammer or in Portal 2 console. I thought it would be easy to go to the source and make sense of this all ... look into the entity keyvalues themselves instead of looking into secondary sources.
Have I made myself clear now? Is there a way to access (read-only) the Entity keyvalue keys and preferably also their values through vscript or whatever else?
I haven't found such list on VDC ... we're talking about developer.valvesoftware.com, right?
Let's just take the trigger_catapult as an example: when I check the corresponding page on VDC, I see multiple entries. Looking at the keyvalues of a trigger_catapult in Hammer will show quite a lot in SmartEdit but once you turn it off there's just about half of the keyvalues left. So this is where you start trying what would be the right key value combination to work with. On top of that, and not necessarily making things easier, there's the autocomplete of the ingame console on the ent_fire command. I've gone through the trouble of compiling the list of 'actions' the Portal 2 console offers for a trigger_catapult entity:
addcontext
addoutput
alpha
alternativesorting
callscriptfunction
clearcontext
clearparent
color
disable
disabledamageforces
disabledraw
disabledrawinfastreflection
disablereceivingflashlight
disableshadow
dispatchresponse
enable
enabledamageforces
enabledraw
enabledrawinfastreflection
enablereceivingflashlight
enableshadow
endtouch
fireuser1
fireuser2
fireuser3
fireuser4
kill
killhierarchy
removecontext
removepaint
runscriptcode
runscriptfile
setdamagefilter
setexactvelocitychoicetype
setlaunchtarget
setlocalangles
setlocalorigin
setparent
setparentattachment
setparentattachmentmainoffset
setphysicsspeed
setplayerspeed
setteam
starttouch
toggle
touchtest
use
You see that there are substantial differences between all 'lists' either on VDC or in Hammer or in Portal 2 console. I thought it would be easy to go to the source and make sense of this all ... look into the entity keyvalues themselves instead of looking into secondary sources.
Have I made myself clear now? Is there a way to access (read-only) the Entity keyvalue keys and preferably also their values through vscript or whatever else?
Quote from innocentive on December 18, 2012, 7:29 pmBrainstone wrote:Give your trigger_catapult the input setlaunchtarget <targetname>. Not listed anywhere, but actually works. Some guys on the forum found this out once. I stumbled upon it and used it. Works perfectly.As launchtarget you can take preferably info_targets, but !player is possible, too. In my map (a bossfight), I parented a point_template to the player, which created static info_targets, which were then shot by bombss a short period of time afterwards.
Thanks for that tip ... but I don't want the trigger_catapult to aim at the player and I had already found 'setlaunchtarget' as you can see in my previous post. Believe me when I say there's no way you can achieve what I want with the IO system of Hammer because (a) there is no particular target to catapult to, and (b) I need to stay in Charge of the flight route which is not possible with Launch targets. In fact I need vector calculations with coordinates that are set by actions of the player. I wish I could be more clear but i don't wanna give my idea away.
Thanks again!
As launchtarget you can take preferably info_targets, but !player is possible, too. In my map (a bossfight), I parented a point_template to the player, which created static info_targets, which were then shot by bombss a short period of time afterwards.
Thanks for that tip ... but I don't want the trigger_catapult to aim at the player and I had already found 'setlaunchtarget' as you can see in my previous post. Believe me when I say there's no way you can achieve what I want with the IO system of Hammer because (a) there is no particular target to catapult to, and (b) I need to stay in Charge of the flight route which is not possible with Launch targets. In fact I need vector calculations with coordinates that are set by actions of the player. I wish I could be more clear but i don't wanna give my idea away.
Thanks again!
Quote from FelixGriffin on December 18, 2012, 10:56 pmThose are all the commands the game recognizes for the entity, not all of them work on that one (they're inherited and do nothing, such as Alpha). Also, KVs only show with SmartEdit off if their value is non-default.
Those are all the commands the game recognizes for the entity, not all of them work on that one (they're inherited and do nothing, such as Alpha). Also, KVs only show with SmartEdit off if their value is non-default.