Aller au contenu

Photo

To modders who use infinite storage mod or similar (about invisible wall bug)


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
anakin5

anakin5
  • Members
  • 258 messages
I don't know where to put such topic so I think the Scripting area is not that bad if modders read it.

Anyway, I introduced a massive bug after using a custom implementation of the infinite storage mod and apologize for this. Invisible wall were appearing randomly on some maps, blocking path for players.
I think it is now fixed for my mod but I know it is not the case for all mods.
It seems that some other mods are using similar system (infinite storage) so here is an information about the bug and how to fix it.

There seems to be 2 causes of the bug :

The first comes from CreateObject method which doesn't like non safe location as argument. I am not sure it can really put the invisible wall at a wrong location but CraeteObject will "chose" a valid location for you if the one you give in parameter is not valid.
So consider using SetLocation right after CreateObject :
[color="#99ccff"]location[/color] lLoc = ...;
[color="#99ccff"]object[/color] oStorage = CreateObject(OBJECT_TYPE_PLACEABLE, R[color="#3366ff"]"genip_invisible_wide.utp"[/color], lLoc, [color="#3366ff"]" "[/color]);
SetLocation(oStorage, lLoc);

This was done in the standard infinite storage mod so most of the time, you don't need to change anything.


The seconds bug is heavy. "char_stage" doesn't exist in Awakening. It's new name is "gxa_char_stage". So if you are too confident and create the Location like this :
[color="#99ccff"]location[/color] lLoc = Location(GetObjectByTag([color="#3366ff"]"char_stage"[/color]), Vector(), [color="#cc99ff"]0.0f[/color]);
You are probably pointing the 0 point of the current map, not the "char_stage". And that's why all storage created when the player use awakening may be created on the wrong map.
So consider checking the validity of the area before doing anything else with it :
[color="#99ccff"]object[/color] oArea = GetObjectByTag([color="#3366ff"]"char_stage"[/color]);

[color="#99ccff"]if[/color] (IsObjectValid(oArea) != [color="#99ccff"]TRUE[/color])
{
    oArea = GetObjectByTag([color="#3366ff"]"gxa_char_stage"[/color]);
}

[color="#99ccff"]if[/color] (IsObjectValid(oArea) == [color="#99ccff"]TRUE[/color])
{
    [color="#99ccff"]location[/color] lLoc = Location(oArea, Vector(), [color="#cc99ff"]0.0f[/color]);
    oStorage = CreateObject(OBJECT_TYPE_PLACEABLE, R[color="#3366ff"]"genip_invisible_wide.utp"[/color], lLoc, [color="#3366ff"]" "[/color]);

    EnablevEvent(oStorage, [color="#99ccff"]FALSE[/color], EVENT_TYPE_INVENTORY_ADDED);
    EnablevEvent(oStorage, [color="#99ccff"]FALSE[/color], EVENT_TYPE_INVENTORY_REMOVED);
    EnablevEvent(oStorage, [color="#99ccff"]FALSE[/color], EVENT_TYPE_INVENTORY_FULL);

    SetTag(oStorage, [color="#3366ff"]"blablabla"[/color]);
    SetObjectInteractive(oStorage, [color="#99ccff"]FALSE[/color]);
    SetLocation(oStorage, lLoc);
}

If you are using talmud storage, it is line 746 of talmud_storage_h file :
[color="#99ccff"]location[/color] lStorage = Location(GetObjectByTag(TAL_STORAGE_AREA_TAG), Vector(), [color="#cc99ff"]0.0[/color]);

Modifié par anakin5, 30 juin 2010 - 09:52 .


#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
From the tests I've run the char_stage area does in fact exist in awakenings, the problem is a bit more complicated than that. In any case, I"ll make a point of finally releasing my updated storage mod this weekend. I've been sitting on a fix for this and several other bugs until I have a chance to finish all the other improvements/additions I've been working on.

(It's beta for a reason, it seems.)

Modifié par Craig Graff, 30 juin 2010 - 10:19 .


#3
anakin5

anakin5
  • Members
  • 258 messages
From my own tests I have :

[color="#99ccff"]object[/color] oArea = GetObjectByTag([color="#3366ff"]"char_stage"[/color]);
IsObjectValid(oArea) [color="#99cc00"]// return FALSE in Awakening;[/color]



I don't know if "doesn't exist" is the right term, but from script, the behavior is like the area is not loaded in memory by default.



Do you mean what I said doesn't solve the problem of Invisible walls ?

What is the more complicated problem you are talking about ?

#4
Desmina

Desmina
  • Members
  • 3 messages
Looking forward to that updated version when it's done. I haven't touched DA myself in a few weeks, but people using my mod are running into invisible walls and from the various topics about it I haven't been able to figure out how to fix my mod yet. So I hope the updated var storage may repair it. In any case, thanks for making the var storage, it allowed me to do some fun things with my mod.