Is it possible to spawn a camera in runtime then send the view from that camera to a GUI?
#1
Posté 29 décembre 2010 - 05:22
I want to be able to send the image from a camera (as in a cutscene) to a GUI. Is this possible?
#2
Posté 29 décembre 2010 - 05:43
#3
Guest_Chaos Wielder_*
Posté 29 décembre 2010 - 07:25
Guest_Chaos Wielder_*
I'm nearly positive you can get the view of the PC's camera and then restore it at some later point. Putting it into a GUI, however, seems a bit tricky. Let us know how it goes.
#4
Posté 29 décembre 2010 - 08:37
#5
Posté 29 décembre 2010 - 08:59
For me spawning a camera is perhaps only the first part of the problem. It needs to point where you want it to and that will be much more tricky.
PJ
#6
Posté 29 décembre 2010 - 10:48
Chaos Wielder wrote...
Maybe? Possibly? You'd have to try it out. NWN-->NWN2 scripts can work, but sometimes the functionality is altered or removed.
I'm nearly positive you can get the view of the PC's camera and then restore it at some later point. Putting it into a GUI, however, seems a bit tricky. Let us know how it goes.
God, I miss the days when I asked easy scripting questions and everyone just told me the answer!
Seriously though, thanks for the response, and I'll keep posting here to update my progress or lack thereof.
#7
Posté 29 décembre 2010 - 10:51
Morbane wrote...
What are you trying to do? Some sort of Clairvoyance or Wizard Eye spell? That would be cool!
That's what I'm going for. It would really make the mage far more powerful because he/she would be able to know what to plan for. I was thinking about making it a spell, but then it would definitely be divination and therefore inaccessible to necromancers, my favorite specialty, so I may just make an item. We'll see. Maybe I'll just cheat and not give it a school!
#8
Posté 29 décembre 2010 - 10:54
PJ156 wrote...
If that is the case perhaps have the spell spawn an I point speaker then start a convo with it. You can then fire off as many camera shots as you please but the camera has to exist already.
For me spawning a camera is perhaps only the first part of the problem. It needs to point where you want it to and that will be much more tricky.
PJ
Yeah, this is going to be tough if it's possible at all. I'm skeptical whether my vision for it is possible. It may turn into creating a creature and somehow scripting it to be invisible and letting the PC posess it somehow and look around for a bit before the PC is forced to unposess it and is warped away.
You know, maybe I could make a creature that joins the party and give it the icon of a spell or crystal ball or something, somehow disable the character GUI for it, and then the PC can just posess it when he/she wants to check out the area. It would have to be flagged as immobile. If the whole GUI thing doesn't pan out, I may use this. Good idea PJ. Thanks.
#9
Posté 29 décembre 2010 - 11:30
Could you temporarily give the mage the survival feat showing up enemies on the existing map or use the spell to reveal the whole map, bad guys and all. the spell could pull up the map GUI with critters on it? I realise that's a compromise but it's some of the way.
If you want to explore the area in the third person then, I guess, a hurdle is going to be having the companions stay still while your extra party member walks around.
It makes me green with envy reading what you guys do with scripting
PJ
#10
Guest_Chaos Wielder_*
Posté 30 décembre 2010 - 01:38
Guest_Chaos Wielder_*
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_PARTY_BAR);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR_2);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR_V1);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR_V2);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_MODEBAR);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_PLAYERMENU);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_ACTIONQUEUE);
CloseGUIScreen(oPC, "SCREEN_MINIMAP");
CloseGUIScreen(oPC, "ChatSelect");
CloseGUIScreen(oPC, "SCREEN_MESSAGE_1");
And don't ask why I have this list available so easily!
#11
Posté 30 décembre 2010 - 06:00
Chaos Wielder wrote...
And don't ask why I have this list available so easily!
That is kinda funny=]
#12
Posté 30 décembre 2010 - 03:31
Chaos Wielder wrote...
If you want to disable all visual UIs for the player and then have them possess something, here you go:
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_PARTY_BAR);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR_2);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR_V1);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_HOTBAR_V2);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_MODEBAR);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_PLAYERMENU);
CloseGUIScreen(oPC, GUI_SCREEN_DEFAULT_ACTIONQUEUE);
CloseGUIScreen(oPC, "SCREEN_MINIMAP");
CloseGUIScreen(oPC, "ChatSelect");
CloseGUIScreen(oPC, "SCREEN_MESSAGE_1");
And don't ask why I have this list available so easily!
Hey, funny that you should mention this, I was just wondering how do to this. Could I use the DisableGUIScreen command to make sure they don't get pulled back up until I want them back up?
I think this is the route I will probably take, thanks for the info it will be very useful.
Cheers
#13
Guest_Chaos Wielder_*
Posté 30 décembre 2010 - 03:34
Guest_Chaos Wielder_*
#14
Guest_Chaos Wielder_*
Posté 30 décembre 2010 - 03:46
Guest_Chaos Wielder_*
#15
Posté 30 décembre 2010 - 04:12
#16
Posté 31 décembre 2010 - 04:10
In either case if you are opting for moving the PC (faked out though) You'll need to Immobilize the PC for a fixed position scry, set the PC to script hidden, and as the others said turn off the gui possibly. If in related to your question on the scripting forums you are aiming to find a way to get feedback to move the camera or at least turn it, You shoudl create a new gui screen "Scry controls" with buttons that let you move the camera via callbacks. However for that your better off just making a mobile scry position, and allowing the PC to move around.
#17
Posté 31 décembre 2010 - 04:27
Thanks for the response.
#18
Posté 31 décembre 2010 - 05:49
#19
Posté 31 décembre 2010 - 08:50
Theoretically, a server-side modification (such as a NWNX plugin) might allow an already placed static camera object to be moved (I haven't tested what the client's reaction to this would be, but there is a protocol for updating object positions, not exposed via script however). New static camera objects cannot be created on the fly effectively as the only way to inform the client of them is during initial area loading.
#20
Posté 05 janvier 2011 - 07:43
- Remove the player from their party
- Create a temporary roster creature with a guaranteed unique name via AddRosterMemberByTemplate or AddRosterMemberByObject
- Create the new roster member (if you used AddRosterMemberByTemplate)
- Make the roster member creature invisible and stuck in place (and otherwise made harmless)
- Transfer object control to the new roster member via SetOwnersControlledCompanion. Unfortunately, it looked to me like this checks that the target object is really a roster member first, so you probably will have to deal with the roster functions beforehand as noted above.
- When the PC is done, restore previous control with SetOwnersControlledCompanion and clean up the roster object.
Here, the roster object functions as a way to move the player's viewpoint around without moving their PC object. (For example, if you wanted to keep the PC vulnerable to attack while they're off scrying or whatnot.)
You'll probably want to test this when multiple players are in use if this is not for single player only.





Retour en haut






