Forum rules


Before adding a bug or feature request please check it is not already in the bug tracker or answered in the FAQ.



WeaponRepeat - new node, a whole new world of weapons!

Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Sat Jan 13, 2007 7:30 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
<updateposition> is now available in cvs for the following weapon primitives:
WeaponTranslate, WeaponRedirect, WeaponScatterPosition, WeaponScatterDirection, WeaponVelocity, and WeaponRedirect.
Note that it actually will retain the adjusted velocity as well as position (where applicable).

Let me know if I missed any.

cbx
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 13, 2007 8:14 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
Nice work cbx!! :D

That sounds perfect. That will certainly make some of the more lengthy and tedious accessory styles much shorter and simpler to code. :)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 3:30 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked



Joined: Sat Dec 18, 2004 7:20 pm
Posts: 2015
Location: USA
cbx550f wrote:
<updateposition> is now available in cvs for the following weapon primitives:
WeaponTranslate, WeaponRedirect, WeaponScatterPosition, WeaponScatterDirection, WeaponVelocity, and WeaponRedirect.
Note that it actually will retain the adjusted velocity as well as position (where applicable).

Let me know if I missed any.

cbx


*drools* :wink:

Ahem, now I can have my Plasma Blast only be a few hundrand lines of code!

Cbx while your in the adding mood how about giving my idea a looke
WeaponExplosion changes.
This would break every mod again though :(

This is unless Gavins already lightyears ahead of us again in what hasn't been commited yet. :shock: :D

-edit-
Forget what I said about breaking mods, the new way to use biods already broke all mods come next version. Whats one more mod breaking change?
Beware the VOID

When in doubt on why your mod broke...
it's all Bobirov's fault.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 8:09 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
jdog wrote:
Cbx while your in the adding mood how about giving my idea a looke
WeaponExplosion changes.

I'll post a reply there.

Quote:
This would break every mod again though :(

No pain, no gain! ;)
In all seriousness - I took a gander at your request noted above, and I think it could be done without breaking old accessories (I'll look at it in the morning). If it does break compatibility, we may have to way out the benefits.... in almost all cases, I'd say, the benefits of adding something outweigh the drawbacks. ;)

Quote:
This is unless Gavins already lightyears ahead of us again in what hasn't been commited yet. :shock: :D

He's sneaky like that. :P

Quote:
-edit-
Forget what I said about breaking mods, the new way to use biods already broke all mods come next version. Whats one more mod breaking change?

Something tells me that there may be a couple. ;)
Although... I seem to have told Rob that I'd work on a script to help with some.... that's a while away though (thankfully ;))
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 11:09 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked



Joined: Sat Dec 18, 2004 7:20 pm
Posts: 2015
Location: USA
I looked at it and thanks again for giving it a go, the idea got burried with all the other things posted.

If this is added and with the new <updateposition> tag, I should beable to get some new ideas flowing and condense down some of the code.
Beware the VOID

When in doubt on why your mod broke...
it's all Bobirov's fault.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 3:44 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
Don't want to rain on the party, but I am not sure I like the fix :(

Its quite risky from a code maintenance, outcome predictablility point of view. As it changes a reference and you have no way of knowing which previous weapon/action owns the memory, you cannot see from the XML how many items you are affecting. In fcat it should really be a const reference so you couldn't change it all (but c++ constness isn't very well implemented).

Plus, you have to add it all of the new/existing weapons which is a bit nasty!


I was thinking of something like this.....


Code:
   
      <accessory>
                <name>UpdatePos Test</name>
                <armslevel>10</armslevel>
                <description></description>
                <icon>bmissile.bmp</icon>
                <startingnumber>-1</startingnumber>
                <activationsound>shoot/small.wav</activationsound>
                <accessoryaction type="WeaponLabel">
                      <label>label_a</label>
                      <nextweapon type="WeaponTranslate">
                                <translatedist>20</translatedist>
                                <nextaction type="WeaponMulti">
                                     <subweapon1 type="WeaponReference">
                                           <weapon>Smoke Tracer</weapon>
                                     </subweapon1>
                                     <subweapon2 type="WeaponGotoLabel">
                                           <label>label_a</label>     
                                           <count>3</count>
                                           <delay>0.0</delay>
                                     </subweapon2>
                                </nextaction>
                        </repeatweapon>
                </accessoryaction>
        </accessory>



While perhaps not as obvious XML code wise, it does get rid of all of the above issues, and means you can now chain a repeat from any position changing weapon.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 10:25 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
gcamp wrote:
Its quite risky from a code maintenance, outcome predictablility point of view. As it changes a reference and you have no way of knowing which previous weapon/action owns the memory, you cannot see from the XML how many items you are affecting. In fcat it should really be a const reference so you couldn't change it all (but c++ constness isn't very well implemented).


Good point. Agreed.

Quote:
Plus, you have to add it all of the new/existing weapons which is a bit nasty!

Actually, no, you don't - if it is omitted it's business as usual. ;)


Quote:
I was thinking of something like this.....

Code:
   
      <accessory>
                <name>UpdatePos Test</name>
                <armslevel>10</armslevel>
                <description></description>
                <icon>bmissile.bmp</icon>
                <startingnumber>-1</startingnumber>
                <activationsound>shoot/small.wav</activationsound>
                <accessoryaction type="WeaponLabel">
                      <label>label_a</label>
                      <nextweapon type="WeaponTranslate">
                                <translatedist>20</translatedist>
                                <nextaction type="WeaponMulti">
                                     <subweapon1 type="WeaponReference">
                                           <weapon>Smoke Tracer</weapon>
                                     </subweapon1>
                                     <subweapon2 type="WeaponGotoLabel">
                                           <label>label_a</label>     
                                           <count>3</count>
                                           <delay>0.0</delay>
                                     </subweapon2>
                                </nextaction>
                        </repeatweapon>
                </accessoryaction>
        </accessory>



While perhaps not as obvious XML code wise, it does get rid of all of the above issues, and means you can now chain a repeat from any position changing weapon.

I'm liking the idea, but a bit confused. Kinda looks like a recursive loop! (Might just be because I'm WAY too tired)

EDIT: I'll undo those changes tomorrow... I'm too tired tonight and to likely to mess something up. ;)
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 10:38 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
gcamp wrote:
I was thinking of something like this.....

...

While perhaps not as obvious XML code wise, it does get rid of all of the above issues, and means you can now chain a repeat from any position changing weapon.

I think I see how thats working, almost identical to how WeaponRepeat is setup currently. So long as the updated position/velocity is used when you go back to the label each time, it would work just like we need. If it doesn't do that, its essentially a slightly more complicated WeaponRepeat. ;)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 12:15 am 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
cbx550f wrote:
Quote:
Plus, you have to add it all of the new/existing weapons which is a bit nasty!

Actually, no, you don't - if it is omitted it's business as usual. ;)


What I meant was you had to alter the code for many weapons so it could work for each different weapon that updates the position. e.g. WeaponTranslate, WeaponRedirect, WeaponScatterPosition, WeaponScatterDirection.....

Quote:
I'm liking the idea, but a bit confused. Kinda looks like a recursive loop! (Might just be because I'm WAY too tired)


Yeah, its basically a goto (with a count). But passes the position + velocity from the caller to callee. It doesn't look as nice though, but does allow you to do things like repeating after a projectile has finished etc...

Quote:
EDIT: I'll undo those changes tomorrow... I'm too tired tonight and to likely to mess something up. ;)


Sorry.


Last edited by gcamp on Mon Jan 15, 2007 12:17 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 12:16 am 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
Bobirov wrote:
gcamp wrote:
I was thinking of something like this.....

...

While perhaps not as obvious XML code wise, it does get rid of all of the above issues, and means you can now chain a repeat from any position changing weapon.

I think I see how thats working, almost identical to how WeaponRepeat is setup currently. So long as the updated position/velocity is used when you go back to the label each time, it would work just like we need. If it doesn't do that, its essentially a slightly more complicated WeaponRepeat. ;)


Yes, the idea would be it would keep the vel and pos from the caller.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 3:12 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
gcamp wrote:
cbx550f wrote:
Quote:
Plus, you have to add it all of the new/existing weapons which is a bit nasty!

Actually, no, you don't - if it is omitted it's business as usual. ;)


What I meant was you had to alter the code for many weapons so it could work for each different weapon that updates the position. e.g. WeaponTranslate, WeaponRedirect, WeaponScatterPosition, WeaponScatterDirection.....


Ahh, I misunderstood - I thought you meant in the XML. ;)
Initially I was looking at how to do it by adding to WeaponRepeat, but then I saw an easy out with doing it the BFI* way in the individual weapons. ;)

*Brute Force and Ignorance. A prof I had in a C course years ago used to write "BFI - 8/10" on perfectly "functional" programs when there were much smarter ways to accomplish the task. ;)

I can start working on this tomorrow, if you want. This stuff is good for me to do (read: Easy enough for my wee brain ;)).
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 3:44 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked








Joined: Fri Nov 12, 2004 3:54 pm
Posts: 3291
Location: Apoc City USA - outnumbered, but still fighting.
Nice work cb, even if Gavin wasn't impressed, I was. (women go for muscle over brains every time, so no worries :P)

I read through the latest with my brain bucket on as tight as possible, this is really cool stuff. Sometimes its really fun just having a loose grasp on programming :) I took one single C language class my freshman year in Engineering school and got an A, but yeah, that was um, nearly 9 years ago :shock:
Chopper:
I really enjoy talking with folks in other countries, drinking stoli/tonic... pulling off shots that seem impossible, drinking..

Fact: CO2 = less than .04% (.00038) of the atmosphere - only a small fraction of that is man made.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 5:15 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
cbx550f wrote:
I can start working on this tomorrow, if you want. This stuff is good for me to do (read: Easy enough for my wee brain ;)).


Sure, anytime you want.

I've changed the weapon creation to have a context that's passed to each sub-weapon during the weapon building. I've also added a context that's passed to each weapon as its called (during the shot). So you should be able to use those to do it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 8:28 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
gcamp wrote:
I've changed the weapon creation to have a context that's passed to each sub-weapon during the weapon building. I've also added a context that's passed to each weapon as its called (during the shot). So you should be able to use those to do it.


Saw that last night - even in my tired stupor it looked like it would help. Thanks ;)
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 10, 2007 7:09 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
Is this still on going, no pressure just wondering if it needs picked up.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group