Creating Weapons
Quote from boctroy on June 4, 2014, 11:24 amNever mind i figured it out
Never mind i figured it out
https://developer.valvesoftware.com/wik ... ng_Weapons
Quote from boctroy on June 9, 2014, 8:43 pmHey Fellows,
Sorry to bother you again. I really like changing the weapon_portalgun.txt file to change my weapon, however i was wondering if there is a way to dynamically change this in mid-game. I want to have about 5 different weapons in the level so if anyone knows how to get this done i would be grateful.
I don't mind scripting so if you know a way to do it that way its okay.
Hey Fellows,
Sorry to bother you again. I really like changing the weapon_portalgun.txt file to change my weapon, however i was wondering if there is a way to dynamically change this in mid-game. I want to have about 5 different weapons in the level so if anyone knows how to get this done i would be grateful.
I don't mind scripting so if you know a way to do it that way its okay.
Quote from TeamSpen210 on June 9, 2014, 11:14 pmI don't think it's possible to actually change weapons in Portal 2 (Valve removed a lot of code for features they weren't using). You might be able to fake it by parenting a weapon model to the player, or using a logic_measure_movement (can't remember which works better). Perhaps you can set the weapon_portalgun model to be an invisible model, and parent to the same attachment it uses. Then you can make logic to enable/disable draw of custom weapons, probably using an animation first to make them drop down offscreen like the portalgun has.
I don't think it's possible to actually change weapons in Portal 2 (Valve removed a lot of code for features they weren't using). You might be able to fake it by parenting a weapon model to the player, or using a logic_measure_movement (can't remember which works better). Perhaps you can set the weapon_portalgun model to be an invisible model, and parent to the same attachment it uses. Then you can make logic to enable/disable draw of custom weapons, probably using an animation first to make them drop down offscreen like the portalgun has.
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]
Quote from boctroy on June 10, 2014, 2:13 pmTeamSpen210 wrote:You might be able to fake it by parenting a weapon model to the player, or using a logic_measure_movement (can't remember which works better).This is what i have already done in the past, and i do agree it is a sure way to do it. I would just be alot smoother and cooler (i think) if i could add actual weapons instead of parenting models.
Please if anyone has anyother ideas don't be afraid to post
This is what i have already done in the past, and i do agree it is a sure way to do it. I would just be alot smoother and cooler (i think) if i could add actual weapons instead of parenting models.
Please if anyone has anyother ideas don't be afraid to post
Quote from FelixGriffin on June 15, 2014, 11:21 amUnfortunately there's no real way. Trying to mess with the viewmodel entity via scripting generally leads to either no effect or crashes.
Unfortunately there's no real way. Trying to mess with the viewmodel entity via scripting generally leads to either no effect or crashes.
Quote from CamBen on June 15, 2014, 3:22 pmTo get a very smooth moving effect on custom viewmodels, you can technically parent models to the portalgun viewmodel, turned invisible, but it is incredibly unreliable and generally not a good method for weapons, as it requires tons of console commands and perfect positioning. I don't recommend it. However, if you are making a sourcemod, then you can edit the portalgun model and change the potatOS bodygroup to look completely different, such as a paint gun, and then swap between those using a logic_playerproxy.
To get a very smooth moving effect on custom viewmodels, you can technically parent models to the portalgun viewmodel, turned invisible, but it is incredibly unreliable and generally not a good method for weapons, as it requires tons of console commands and perfect positioning. I don't recommend it. However, if you are making a sourcemod, then you can edit the portalgun model and change the potatOS bodygroup to look completely different, such as a paint gun, and then swap between those using a logic_playerproxy.
Aperture Science: We do our science asbestos we can!
Quote from FelixGriffin on June 16, 2014, 7:08 amThat's brilliant, I'll have to try that.
That's brilliant, I'll have to try that.