Transfer an object from level to level inside the game!
by David Mortensen · in Torque 3D Professional · 10/30/2010 (2:03 pm) · 4 replies
Hi i'm pretty new to Torque and TorqueScript but i wish to make a good old Crash Bandicoot Style game where it basically run and jump on enemies heads :P but i cannot seem to find a resource here in the forums about how to take an TSStatic object (e.g. a Dog Bone!) from the first level to (e.g. the Warp Room!!)
I know that this is either very simple OR very difficult to achieve but PLEASE help me i just can't find a single topic or thread about it and i am already at a good start of my game...
Thanks a million times in advance...
EDIT: what i mean is that i only understand a few of the codes and i don't know which line of code i can use as a "object transfer" to "transfer" an object from one level to another it in-game i mean i don't mean in the editor :) it is because i want to make an all new kind of old Crash B. styled game and i want to transfer a golden dog bone to the Warp Room from each of the levels... Is there anyone who will be so kind and tell me how i can make this work?
- David Mortensen.
I know that this is either very simple OR very difficult to achieve but PLEASE help me i just can't find a single topic or thread about it and i am already at a good start of my game...
Thanks a million times in advance...
EDIT: what i mean is that i only understand a few of the codes and i don't know which line of code i can use as a "object transfer" to "transfer" an object from one level to another it in-game i mean i don't mean in the editor :) it is because i want to make an all new kind of old Crash B. styled game and i want to transfer a golden dog bone to the Warp Room from each of the levels... Is there anyone who will be so kind and tell me how i can make this work?
- David Mortensen.
About the author
Hi i have always had an interest in gaming and now i really wanna go ahead and do something with my obsession for games :D
#2
i want to create an object say an bone.dae and i want it to be in each level but i want the player to have to get the bone only once on each level so that the player cannot get the bone on the same level twice....
i am not quite sure how to explain it otherwise than if you have ever played Crash Bandicoot 2 , 3 and 6 (Cortex Strike Back, Warped and The Wrath of Cortex) then you can get a crystal placed somewhere in each of the levels and one or two gems but if you saved after getting one of the gems or crystals then you could not get it again because you actually have it in your "inventory" so if am to guess i would choose the inventory method... is that the correct one??? (i am very sorry for troubling you but as i have said in the thread, i am a newbie :D)
- David Mortensen.
11/01/2010 (3:00 pm)
Hi Michael and thanks for your reply...i want to create an object say an bone.dae and i want it to be in each level but i want the player to have to get the bone only once on each level so that the player cannot get the bone on the same level twice....
i am not quite sure how to explain it otherwise than if you have ever played Crash Bandicoot 2 , 3 and 6 (Cortex Strike Back, Warped and The Wrath of Cortex) then you can get a crystal placed somewhere in each of the levels and one or two gems but if you saved after getting one of the gems or crystals then you could not get it again because you actually have it in your "inventory" so if am to guess i would choose the inventory method... is that the correct one??? (i am very sorry for troubling you but as i have said in the thread, i am a newbie :D)
- David Mortensen.
#3
The Item class would be the easiest way of doing this. You'll need an Item datablock -- use something like the ammo/weapon or healthpack pickups as an example of an Item datablock. Once you have this you can then place the BoneItem wherever you want with the editor. You will also need to add your Item to the "allowable inventory" section at the bottom of the player datablock. The stock inventory code will then automatically handle picking the BoneItem up and incrementing it in the player inventory.
The key to allowing only one is to set the invMax to "1" in the player datablock. This way, even if there multiple bones in a level, if the player has already picked one up then he would only be allowed to get one of them.
Anything more involved than that will need some further scripting and knowledge of the inner workings of your game.
11/01/2010 (3:25 pm)
Never played, but vaguely familiar with it and I think I grasp what you're wanting....The Item class would be the easiest way of doing this. You'll need an Item datablock -- use something like the ammo/weapon or healthpack pickups as an example of an Item datablock. Once you have this you can then place the BoneItem wherever you want with the editor. You will also need to add your Item to the "allowable inventory" section at the bottom of the player datablock. The stock inventory code will then automatically handle picking the BoneItem up and incrementing it in the player inventory.
The key to allowing only one is to set the invMax to "1" in the player datablock. This way, even if there multiple bones in a level, if the player has already picked one up then he would only be allowed to get one of them.
Anything more involved than that will need some further scripting and knowledge of the inner workings of your game.
#4
I am about to create the bone so i can test it out properly :) i am very grateful for your quick replies and friendliness ;)
- David Mortensen.
11/01/2010 (4:04 pm)
Thanks alot for your reply again :)I am about to create the bone so i can test it out properly :) i am very grateful for your quick replies and friendliness ;)
- David Mortensen.
Associate Michael Hall
Distracted...
All three methods I just mentioned would need creation of a global flag that says send this object on level change, something to check that global, and something to instantiate your bone object - which if is to be in a different position for each level would require some sort of marker object placed in the editor so that such a "check to allow bone" method would know where to place the bone.
Are you wanting to dynamically create this bone for each level? What are the conditions for sending/allowing the bone? Why do you not want to simply have one previously established in the mission through the editor? Without knowing/understanding the mechanic or reasoning for the bone makes it hard to say "how" to do this.