Need help with mod (with crash to desktop issues)

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I've got a problem with http://xelerus.de/index.php?s=mod&id=531. My mines, generated with syscreateweaponfire, do not detonate on proximity to enemy ships as the NAMI mines, generated directly as normal weapon fire, do. I have, however, tested that other fragmenting weapons fragment properly when near enemies when generated by syscreateweaponfire. Any help would be appreciated. My mines do fragment properly at the end of their lifetimes, just not on proximity.

[edit] that's been fixed by making the mines wobble. That just leaves an unpredictable crash bug and a crash on load when there are mines in space. Technically George is supposed to be responsible for crash bugs, but workarounds are still desired so the mod will be useable in the current version. [/edit]
Last edited by Atarlost on Mon Aug 10, 2009 5:29 am, edited 1 time in total.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

we got the shots to fragment correctly but we still have a few issues. Without checking for object data we couldn't tell if a shot was valid. It would crash the second time it was detonated. There are also rarer crashes that do not come up all the time we do not know where they are coming from but they happen around when a shot detonates (could only find it happening rarely or when many where going off at the same time).

Atarlost has make a ticket related for this http://wiki.neurohack.com/transcendence/trac/ticket/109
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

we found that we solved the crashes when we used objGetID and objGetObjByID instead of the objects themselves. We are not sure why.
Crying is not a proper retort!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

A few questions:

1. Before you switched to (objGetObjByID), were you using (objSetObjRefData) to store the shot pointer? (or were you using objSetObjData?)

2. It looks like you destroy and recreate the shot on every call through Decay. Why is that? Why can't you just change the pos/vel of the shot? [I may need to add some more functions for you.]

3. Remember to treat object pointers specially. For efficiency, the object pointer returned by (sysCreate???) is a naked pointer to the underlying C++ object. That means that the pointer is only valid for a given game sessions and only while the object is alive. (objSetObjRefData) knows that it has a pointer and knows how to store it properly.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

we used objSetObjData. We should have used objSetObjRefData but that would still would have had the save crash. (I forgot about objSetObjRefData)

objIncVel is very picky on what it accepts. That maybe due to how we stop the shot with objMove. When we get the vel and stop it and then inc the vel by the old vel it doesn't move.

I am not sure why new shots where created in decay for that you would have to ask Atarlost.
Crying is not a proper retort!
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

1) I used objsetData and objGetData. None of the other functions you mention are documented on Xelerus that I've found.


2) I destroy and recreate the shot because I know of no way to either alter the lifetime of the shot or command detonate it and I wanted a random lifetime. Until counter runs down to 2 there is a 1 in counter chance of the shot detonating at each cycle.

3) Is efficiency so important that you have to pass the script naked pointers? No offense, but that strikes me as very dangerous. A malevolent scripter could create a mod that corrupts the game by using offsets on pointers, and one who knew machine language might be able to insert his own code into executable memory as is done in buffer overrun attacks on some systems.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

maybe you didn't see them but objSetObjRefData and objGetObjByID are on Xelerus.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

some functions that would be useful in the manipulation of an objects velocity.

objSetVel: We stop then inc the vel so much so we could control the speed it would be nice if we could directly set it.

objSetSpeed: When adding vectors together sometimes (well nearly all the time) the speed changes and for things like weapons that we want a constant speed of a shot. Being able to set the speed would save some steps.

objSetDirection: Not as useful as objSetSpeed but sometimes you want to change the direction something is traveling without changing the speed.
Crying is not a proper retort!
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

For shots we don't want constant speed. We want the velocity component from source motion added on afterwards.

Something like
(objsetvel (stufftocalculatethedesiredvector))
(objincvel basevelocity)
where basevelocity is the stored vector from the source object at the time of firing.

We just need objincvel fixed so it can take vectors that aren't sanitized through sysvectorpolaroffset
Post Reply