Are "global" objects possible?
#26
Posté 20 novembre 2009 - 03:05
as for the #include's do .nss scripts generate _h files? and can I forward declare arrays and functions?
if I can does DA scripting support dynamic arrays/vectors(not locations vectors).
#27
Posté 20 novembre 2009 - 03:17
void main()
{
object oChest;
object[] objects;
}
Compiles fine.
Your work will be in making an array of resources, I am not sure if you can type cast the resources to Item or not since resource type appears to be a variable itself (enum/int).
Modifié par Nodrak, 20 novembre 2009 - 03:25 .
#28
Posté 20 novembre 2009 - 03:25
#29
Posté 20 novembre 2009 - 03:29
so
object[] objects
void main()
{
}
no idea if that would compile or not.
*edit* Yep that compiles as well I shall test it out properly after I finish work.
Modifié par Quildra, 20 novembre 2009 - 03:30 .
#30
Posté 20 novembre 2009 - 03:35
Modifié par Nodrak, 20 novembre 2009 - 03:37 .
#31
Posté 20 novembre 2009 - 03:40
#32
Posté 20 novembre 2009 - 03:43
#33
Posté 20 novembre 2009 - 03:44
So the first time it is spawned i assign it to the and object outside of main. once i move areas the next time it is summoned I move it to the new area like I normally move the chest.
If this works then we have found a way to get global objects
#34
Posté 20 novembre 2009 - 03:46
Nodrak wrote...
There is a file that has basically what you need for getting the inventory: _Debug/getinventory.nss
hmm, will have to take a look at that - is this any different than the Standard GetInventoty() function implemented (wich didn't return anything in the leave event - maybe because they were allready unloaded?)
#35
Posté 20 novembre 2009 - 03:46
AND04 wrote...
hmm, nice going - will try that stuff later on as well - problem being though that there is no "Inventory closed" event - just a Open Inventory one - and i wasn'T able to access the chest inventory in the leave area event either hmm :S
There is PLACEABLE_ACTION_CLOSE but I've never tried to use it yet but it might be worth giving that a go.
#36
Posté 20 novembre 2009 - 03:47
Quildra wrote...
AND04 wrote...
hmm, nice going - will try that stuff later on as well - problem being though that there is no "Inventory closed" event - just a Open Inventory one - and i wasn'T able to access the chest inventory in the leave area event either hmm :S
There is PLACEABLE_ACTION_CLOSE but I've never tried to use it yet but it might be worth giving that a go.
hmm, how did i miss that? - thx gona try
though hmm, is that an action of the "Use" event?
Modifié par AND04, 20 novembre 2009 - 03:48 .
#37
Posté 20 novembre 2009 - 03:50
#38
Posté 20 novembre 2009 - 03:51
Quildra wrote...
Its a placeable action but i believe it is generated from an EVENT_TYPE_USE
bah overriding that Event is such a pain in the ass (using it in my Auto Loot Mod) :/
btw - what i am trying to do is actually quite similar to what you wanna do now - i want to be able to access a defined amount of chest-inventorys (Wardens Keep, the Example Partychest and maybe some others that are popular like the Beyond Feraldens) from anywhere using some sort of summoning item (code for that was finished long ago)
can't wait to try that new approach now
Modifié par AND04, 20 novembre 2009 - 03:56 .
#39
Posté 20 novembre 2009 - 03:53
Modifié par Nodrak, 20 novembre 2009 - 03:54 .
#40
Posté 20 novembre 2009 - 03:54
*edit*
Yeah it might be safer seen as the engine really doesn't seem to want to let us have a global object
Modifié par Quildra, 20 novembre 2009 - 03:59 .
#41
Posté 20 novembre 2009 - 03:58
Quildra wrote...
seemed simple enough when I did it. I just have an interaction script on my chest so i can handle any events that get called on it. Then if its one I don't have I route it back to the main game.
Its simple if you limit it to a specific object true - but in case of the Auto Loot Mod i have to override the whole thing - means all Use events fire into my override first.
#42
Posté 22 novembre 2009 - 08:12
a combination of GetObjectByTag and SetLocation can be used to move objects in and out of the char_stage area which is accessible from anywhere in the game.
Modifié par Craig Graff, 22 novembre 2009 - 08:17 .





Retour en haut






