Outputs on keyboard buttons/console commands?
Quote from yohoat9 on January 6, 2011, 6:41 pmI'm working on an in game map editor, similar to po_edit_03, but way nicer, more advanced, and more user friendly. I'm going to be using a camera angle entity parented to a "cursor" of some sort, I have the whole thing planned, and have ran a few tests to make sure that the cursor moves and spawns brushes correctly, but I didn't like po_edit_03's "shoot the button" type of editing, I want to have outputs on +duck, +jump, the directional commands, etc. So how do I have an output using the console commands? I know how to use the client_command entity, but is there a way to use this for outputs also?
Also if anyone wanted to know, the editor is going to be "block" based, minecraft-like, if you will. The directional buttons will move the cursor one block of a given direction, clicking will place a block, (I'm still not sure how it'll switch what type you're placing), right click will probably take away a block. Ctrl/+duck will go down one block, space/+jump will raise one block. Something else will have to be rotate, for angled blocks.
I'm working on an in game map editor, similar to po_edit_03, but way nicer, more advanced, and more user friendly. I'm going to be using a camera angle entity parented to a "cursor" of some sort, I have the whole thing planned, and have ran a few tests to make sure that the cursor moves and spawns brushes correctly, but I didn't like po_edit_03's "shoot the button" type of editing, I want to have outputs on +duck, +jump, the directional commands, etc. So how do I have an output using the console commands? I know how to use the client_command entity, but is there a way to use this for outputs also?
Also if anyone wanted to know, the editor is going to be "block" based, minecraft-like, if you will. The directional buttons will move the cursor one block of a given direction, clicking will place a block, (I'm still not sure how it'll switch what type you're placing), right click will probably take away a block. Ctrl/+duck will go down one block, space/+jump will raise one block. Something else will have to be rotate, for angled blocks.
Quote from WinstonSmith on January 6, 2011, 6:57 pmAlright, right away I'm warning you about creating an ingame editor...you may have the best intentions, but ingame editors aren't quite looked up to by the community.
If you must continue, though, you'll have to bind the keys used whenever the map is loaded. You normally do this by entering
- Code: Select all
bind <key> "command"
(you only have to use the double quotes there if the desired command contains a space). However, these are absolute keys and won't change if the user has some other key bound to directions, firing, jumping, crouching, etc. I'm not sure why they would, but whatever. Therefore, I don't know if you can bind commands to actions instead of keys, i.e.
- Code: Select all
bind +use "ent_fire block_spawner ForceSpawn"
You can feel free to try it though; mess around and see what works. To make sure that these work when the map is loaded, you'll have to have a logic_auto that fires all these bind commands as soon as the map spawns through a point_clientcommand. Finally, and perhaps most importantly, look into how to string together commands (have one fire immediately after the first). This is crucial because it will make sure that in other maps, the player can still move around and use the keys for their normal functions.
Like I said, I don't even know if you can bind commands to things like +jump or +crouch. You may have to resort to just using the default keys and hoping that the few people whose special key layouts are reset don't care. And finally, once again, ingame map editors aren't the most popular of items, but if you can make something that complex work best of luck to you. Hope I've helped.
Alright, right away I'm warning you about creating an ingame editor...you may have the best intentions, but ingame editors aren't quite looked up to by the community.
If you must continue, though, you'll have to bind the keys used whenever the map is loaded. You normally do this by entering
- Code: Select all
bind <key> "command"
(you only have to use the double quotes there if the desired command contains a space). However, these are absolute keys and won't change if the user has some other key bound to directions, firing, jumping, crouching, etc. I'm not sure why they would, but whatever. Therefore, I don't know if you can bind commands to actions instead of keys, i.e.
- Code: Select all
bind +use "ent_fire block_spawner ForceSpawn"
You can feel free to try it though; mess around and see what works. To make sure that these work when the map is loaded, you'll have to have a logic_auto that fires all these bind commands as soon as the map spawns through a point_clientcommand. Finally, and perhaps most importantly, look into how to string together commands (have one fire immediately after the first). This is crucial because it will make sure that in other maps, the player can still move around and use the keys for their normal functions.
Like I said, I don't even know if you can bind commands to things like +jump or +crouch. You may have to resort to just using the default keys and hoping that the few people whose special key layouts are reset don't care. And finally, once again, ingame map editors aren't the most popular of items, but if you can make something that complex work best of luck to you. Hope I've helped.
Quote from yohoat9 on January 6, 2011, 7:10 pmYeah, thanks for the quick reply. First of all in the beginning you said how the community didn't look up to in game editors, but this is mainly to make quick sketches of chambers without having to worry about lighting, leaks, etc.
Also I may have worded part of that wrong, I didn't necessarily mean an output on +jump, but on space in general, I was using +jump as an example because I was thinking of the client_command. So something along the lines of this:
- Code: Select all
bind space "<enity> <entity name> <output>"
I'm definitely going to at least try though, if I fail, I've only gained experience and knowledge.
Yeah, thanks for the quick reply. First of all in the beginning you said how the community didn't look up to in game editors, but this is mainly to make quick sketches of chambers without having to worry about lighting, leaks, etc.
Also I may have worded part of that wrong, I didn't necessarily mean an output on +jump, but on space in general, I was using +jump as an example because I was thinking of the client_command. So something along the lines of this:
- Code: Select all
bind space "<enity> <entity name> <output>"
I'm definitely going to at least try though, if I fail, I've only gained experience and knowledge.
Quote from WinstonSmith on January 6, 2011, 7:15 pmyohoat9 wrote:Also I may have worded part of that wrong, I didn't necessarily mean an output on +jump, but on space in general, I was using +jump as an example because I was thinking of the client_command. So something along the lines of this:
- Code: Select all
bind space "<enity> <entity name> <output>"
Not quite. You've got the right idea, though. First, not sure if typing "space" in there will work. It probably will, though. Second, in the quotes, it should be
- Code: Select all
ent_fire <entity_name> <output>
Ent_fire is the console command used to fire outputs when ingame. Basically, it's like any other output, except the OnTrigger or OnStartTouch or OnOpen or whatever is replaced by ent_fire.
- Code: Select all
bind space "<enity> <entity name> <output>"
Not quite. You've got the right idea, though. First, not sure if typing "space" in there will work. It probably will, though. Second, in the quotes, it should be
- Code: Select all
ent_fire <entity_name> <output>
Ent_fire is the console command used to fire outputs when ingame. Basically, it's like any other output, except the OnTrigger or OnStartTouch or OnOpen or whatever is replaced by ent_fire.
Quote from yohoat9 on January 6, 2011, 7:24 pmOh, that makes more sense, when I saw it I just figured it was an entity that I've never used.
Also, thanks for all the help, you seem to be the brains on this forum. I'll report back to this thread later this weekend, after I've made a bit of the editor and tell you how its going, and if I need more help.
Oh, that makes more sense, when I saw it I just figured it was an entity that I've never used.
Also, thanks for all the help, you seem to be the brains on this forum. I'll report back to this thread later this weekend, after I've made a bit of the editor and tell you how its going, and if I need more help.
Quote from WinstonSmith on January 6, 2011, 7:40 pmyohoat9 wrote:Also, thanks for all the help, you seem to be the brains on this forum.Well, thanks, I appreciate it, but believe me, there are a few people here who are a heck of a lot smarter mapping wise than I am. I think they just tend to lurk in the shadows a bit.
Well, thanks, I appreciate it, but believe me, there are a few people here who are a heck of a lot smarter mapping wise than I am. I think they just tend to lurk in the shadows a bit.
Quote from p0rtalplayer on January 7, 2011, 4:02 pmHey, just cause he's on the most doesn't mean he's the brains! I would have given you the same responses if I had been on at the time!
Anyway, if you make an editor, PLEASE make some better kind of lighting than fullbright. I don't know how, but try, for the sake of all of our eyes.
Hey, just cause he's on the most doesn't mean he's the brains! I would have given you the same responses if I had been on at the time!
Anyway, if you make an editor, PLEASE make some better kind of lighting than fullbright. I don't know how, but try, for the sake of all of our eyes.
Quote from yohoat9 on January 7, 2011, 4:08 pmp0rtalplayer wrote:Anyway, if you make an editor, PLEASE make some better kind of lighting than fullbright. I don't know how, but try, for the sake of all of our eyes.Don't worry, it was one of my first thoughts, I'm going to use some sort of light placement system. In "editor mode", there will be a sprite showing the base point of the light, and in "play mode" it will take away the sprite. Also, when you change to "play mode", I'll have a ton of entities that have the same name, for easy outputs on them.
[edit]
Okay, how do you make the camera appear as the whole screen?
Don't worry, it was one of my first thoughts, I'm going to use some sort of light placement system. In "editor mode", there will be a sprite showing the base point of the light, and in "play mode" it will take away the sprite. Also, when you change to "play mode", I'll have a ton of entities that have the same name, for easy outputs on them.
[edit]
Okay, how do you make the camera appear as the whole screen?
Quote from msleeper on January 7, 2011, 9:45 pmPO Edit is a retarded failure and this will be too. Just FYI. Use hammer, it's not fucking rocket surgery.
PO Edit is a retarded failure and this will be too. Just FYI. Use hammer, it's not fucking rocket surgery.
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.
Quote from Groxkiller585 on January 7, 2011, 10:38 pmmsleeper wrote:PO Edit is a retarded failure and this will be too. Just FYI. Use hammer, it's not fucking rocket surgery.I sympathize with you, Hammer is surely better than any in-game editor, but i don't think you should trash his thread just yet. We don't know how he will have it set up.
(FYI about lighting, IDk how your gonna do that without pre-build and prelit parts of the map...
...unless you found a way to make a VMF IN the map editor, and then found a way to essentially wire Hammer into the game. (Ex. you make the VMF file, and you make models that represent entities. These models has parameters you can change, and these are the keyvalues found in hammer. Then you hit compile, Hammer does the rest. It would be hard to set up properly and probably needs coding, and we all know what happens when you need coding in Portal. It doesn't.)
I sympathize with you, Hammer is surely better than any in-game editor, but i don't think you should trash his thread just yet. We don't know how he will have it set up.
(FYI about lighting, IDk how your gonna do that without pre-build and prelit parts of the map...
...unless you found a way to make a VMF IN the map editor, and then found a way to essentially wire Hammer into the game. (Ex. you make the VMF file, and you make models that represent entities. These models has parameters you can change, and these are the keyvalues found in hammer. Then you hit compile, Hammer does the rest. It would be hard to set up properly and probably needs coding, and we all know what happens when you need coding in Portal. It doesn't.)