Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Loading and then applying animations to objects

Author
Message
MateiSoft Romania
11
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 7th Jun 2015 12:20
Hello Community,

I have a selection of weapons that i must import from a function and then take each one of them and apply some animations to them. I have this code for loading the weapon objects, but the animation part that is in real time i don't know how can i retrieve the each animation information about the each weapon object separately.

Thank You Very Much!



Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Jun 2015 13:52
Some questions:

1. What is the initial value of weaponnumber?
2. What is the difference between weapimp and weaponnumber?
3. Where do you store the object IDs and other information for the individual weapon objects that you want to animate?
4. What's the point of this loop?



Looks like you need some arrays and UDTs in there somewhere.



Powered by Free Banners
MateiSoft Romania
11
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 7th Jun 2015 14:05
Hello Green Gandalf, good to see you!

1. weaponnumber = 6999
2. weapimp is the variable for that for loop that detects how many files that includes weapon objects exists(if that makes sense)
3.Well, the thing is that theoretically i am storing all these values in those values that are processed such as "idleanimationstart$"
4.The last loop is for hiding all the rest of the weapon objects except the first weapon object that is 7000

Lastly, yes i thought about arrays but i wasn't so sure about that idea and how to actually create the array...

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Jun 2015 17:57 Edited at: 7th Jun 2015 18:17
Quote: "Well, the thing is that theoretically i am storing all these values in those values that are processed such as "idleanimationstart$""


Yes, but you are immediately overwriting those values up to 10000 times. When you have finished that loop you will only have the values from the latest successful iteration of the loop. You can access the values you want later if you store them in an array UDT. For example,



You'll obviously need to add more code but that snippet will store all the weapon data found in the files so you can refer to them later in your program. You will probably need to give some thought about which weapons you've found and what object IDs to give them. Your original snippet only records the data from the (Edited) last one found which may be what you intended but seems a long-winded way of doing that.

I suggest you test your code manually using just three weapons and two attributes and work through your code by hand. You'll soon see what's missing. For example, you need an array or linked list which links your object IDs to the weapon numbers. Once you have that you can refer to the appropriate weapon data. Untested example (another two arrays ):



Then later in your code you can find which weapon file data is needed for a given weapon object and vice versa.



Powered by Free Banners
MateiSoft Romania
11
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 8th Jun 2015 01:09
Oh ok,

Now i understand, thank you

Alex Matei CEO
www.alexmatei.com

Login to post a reply

Server time is: 2025-08-09 02:29:58
Your offset time is: 2025-08-09 02:29:58