• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Coming soon to a patch file near you

FoxGaming

Exalted Member
lol this thread is mostly for Tommy since he expressed a deep love toward block based games.

This is just my first attempt at the custom model for my Minecraft to WoW patch. I've already got all the dummy spells ready to go, it's almost perfect!

Haha but as you can see i'm having a little trouble with blender and getting my model to appear upright correctly ingame, oh well, I'll get it figured out.
The credits for Getting my model in game thus far and exporting it correctly go to Anthonys-Toolbox for his great video tutorial and help getting it converted correctly from 3ds.

WoWScrnShot_090613_094352_zps84f676e1.jpg


lol update, my modeling isn't so ugly anymore

WoWScrnShot_090613_210823_zps3e7843d8.jpg
 
Last edited:

FoxGaming

Exalted Member
I just want to make it work then i'll give the files to you since I know you would love to have them lol
 

Tommy

Founder
Oh great! You know the best way to probably do this besides using custom models is use crates. Only if you want a specific amount of colors.. omnom
 

FoxGaming

Exalted Member
I never thought of that, probably would've been faster lol at least now i have a custom model in 3ds/blender so all i need to do is apply a new texture like Planks, export it and convert it. Thank goodness the Gameobject display DBC is super basic, if it was like when I made the dummy spells to spawn these cubes i would've quit.
 

Tommy

Founder
I never thought of that, probably would've been faster lol at least now i have a custom model in 3ds/blender so all i need to do is apply a new texture like Planks, export it and convert it. Thank goodness the Gameobject display DBC is super basic, if it was like when I made the dummy spells to spawn these cubes i would've quit.

I would've quit as soon as I started taliis. Anyway, can't wait to see you finish. :p
 

FoxGaming

Exalted Member
I've got a couple things going on, i've got some blocks with custom models completed. I'm going to take a break from the models and starting getting the spells working, then i'll do a little beta for like 5 people to test and i'll make some changes then start a new project since I know Tommy is going to love playing my WoW Voxel server (;
 

Anthonys-Toolbox

Epic Member
Looks good. ^_^

I guess a way to make them interactive is you could make them have the treasure chest flags, so when they mine(open) the block, they get an item and the block will disapear. lol.
 
Last edited:

FoxGaming

Exalted Member
Looks good. ^_^

I guess a way to make them interactive is you could make them have the treasure chest flags, so when they mine(open) the block, they get an item and the block will disapear. lol.

I really like that idea, i was going to write some complicated DummyEffect that would simulate that, thank you for that, i totally overlooked that. I'm going to be making some items to, so if you have grass blocks you spawn them by clicking them and placing at a whatever is selected, kind of like an AoE spell.
 

Tommy

Founder
I've got a couple things going on, i've got some blocks with custom models completed. I'm going to take a break from the models and starting getting the spells working, then i'll do a little beta for like 5 people to test and i'll make some changes then start a new project since I know Tommy is going to love playing my WoW Voxel server (;

I'll flood your server with my powers. :3

Nah, I could play it, but I'd just be bored. Keep adding more stuff, might be useful. :3
 

FoxGaming

Exalted Member
Tommy, I have a dummy spell that has an AoE select type of function so you can place these blocks anywhere you can reach, kinda like in Minecraft, would you recommend coding the spell in c++ or with Eluna? The idea is that it will place the block at the selected location, I've thought of a couple ways to do it in Eluna i'd just rather it be clean rather than hacky.


I was thinking something along the lines in the Wiki using c++,
Code:
Unit* unit; // No value!
Spell* spell = unit->GetCurrentSpell(CURRENT_GENERIC_SPELL);

if (spell)
{
   // Do something
}


Along with this,
Code:
SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);

I guess the only concerns i have are, is it possible to place it at the selected location, and also is setting respawn time to 0, will it be permanent?
 
Last edited:

Tommy

Founder
Tommy, I have a dummy spell that has an AoE select type of function so you can place these blocks anywhere you can reach, kinda like in Minecraft, would you recommend coding the spell in c++ or with Eluna? The idea is that it will place the block at the selected location, I've thought of a couple ways to do it in Eluna i'd just rather it be clean rather than hacky.


I was thinking something along the lines in the Wiki using c++,
Code:
Unit* unit; // No value!
Spell* spell = unit->GetCurrentSpell(CURRENT_GENERIC_SPELL);

if (spell)
{
   // Do something
}


Along with this,
Code:
SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);

I guess the only concerns i have are, is it possible to place it at the selected location, and also is setting respawn time to 0, will it be permanent?

Well, if you do it in Eluna it is still going to be in C++ either way to implement it in. So you're saying you have a spell and when you right click this spell you will be able to spawn this gameobject anywhere, correct? If so, that shouldn't be hard to do considering all you're doing is placing the block where the circle is. However, let's take the Summon Water Elemental spell for example. The code supporting it doesn't pertain to any code actually spawning the Water Elemental, all it handles is casting the spell. So, I believe you can handle it via Spell.dbc, unless of course you can't spawn gameobjects through spells, which I'm sure you can though. Only thing I know to do via SpellScript is to adjust the summon position and that's it.

On your gameobject question, no, when setting respawn time to 0 it won't respawn in that instance of the server uptime. When it restarts the gameobject will be gone. So, you will need to use SaveToDB() to save the gameobject.
 

Rochet2

Moderator / Eluna Dev
You cant script a spell with eluna in the way that you could use the green AOE circle.
On a related note, my version of GOMove UI edition for TC has a summoning circle coded in C++ with a spell if you need a reference.

(see at the bottom of the c++ script)
http://www.trinitycore.org/f/topic/7038-patch-gomove-trinitycore-with-ui-addon/
You can see me using it in the beginning of the video.
[MENTION=333]FoxGaming[/MENTION]
 
Last edited:

FoxGaming

Exalted Member
Well, if you do it in Eluna it is still going to be in C++ either way to implement it in. So you're saying you have a spell and when you right click this spell you will be able to spawn this gameobject anywhere, correct? If so, that shouldn't be hard to do considering all you're doing is placing the block where the circle is. However, let's take the Summon Water Elemental spell for example. The code supporting it doesn't pertain to any code actually spawning the Water Elemental, all it handles is casting the spell. So, I believe you can handle it via Spell.dbc, unless of course you can't spawn gameobjects through spells, which I'm sure you can though. Only thing I know to do via SpellScript is to adjust the summon position and that's it.

On your gameobject question, no, when setting respawn time to 0 it won't respawn in that instance of the server uptime. When it restarts the gameobject will be gone. So, you will need to use SaveToDB() to save the gameobject.

That indeed answers my question, I can spawn objects with the spell.dbc but they won't stay through a restart which was my only concern.

You cant script a spell with eluna in the way that you could use the green AOE circle.
On a related note, my version of GOMove UI edition for TC has a summoning circle coded in C++ with a spell if you need a reference.

(see at the bottom of the c++ script)
http://www.trinitycore.org/f/topic/7038-patch-gomove-trinitycore-with-ui-addon/
You can see me using it in the beginning of the video.

Posted this before i saw your post, that is exactly what I had in mind, thank you, is it just a dummy spell?

My Original idea to spawn the objects was to make items that were in your inventory much like minecraft, only difference being that when you used the item it would spawn at whatever location determined by the summoning circle unlike in minecraft where you just right click to spawn.
 
Last edited:

Rochet2

Moderator / Eluna Dev
If you see the Cpp it has a comment:
// possible spells:
// 27651, 897

You can look more in the DBC and probably or possibly create more through DBC or client editing anyways.
I cant remember what value it is, but it was some targetting value stuff.
I think I found the spells by checking out the angry programmer spell that summons an NPC to your cursor and found more from there.

The other is a dummy spell I guess and the other is not .. hmm:
http://wotlk.openwow.com/spell=897
http://wotlk.openwow.com/spell=27651

web can be wrong though
 

FoxGaming

Exalted Member
Yeah i noticed those, I know the spell I've created won't spawn a temporary object by itself, if you click on it it shows the green summoning cursor but of course does nothing, i was looking at using c++ to make a script that upon cast/placement would place an object there, my knowledge of c++ is basic, i can read it and understand what it does but implementing anything more than a few edits is beyond my ability.

Like i'm not sure how I would implement something like yours, being the way i have mine set up i would probably have to create a new spell for every gameobject, which isn't a problem since i would just have to copy and paste and change the ID of the spell, in your script you can basically select an object using the UI and spawn it using the spell, in your knowledge would there be a way to write one script using one dummy spell. 27651

Since i'm not making a gui i would need it to determine which item is being used, so i have an item named Planks, as well as the game object that is shown in the screenshots, it has a custom display ID it appears like the planks block, i have my dummy spell linked so that upon Item use it would spawn. Would there be a way to use one spell, and have it distinguish between which item would spawn each separate object? For Example, the Grass Item spawns the Grass Block at the selected location using spell 27651 which is a dummy effect spell.

[MENTION=6]Rochet2[/MENTION]
 
Last edited:

Rochet2

Moderator / Eluna Dev
I think you can.

You can use the spellscript part of mine and then just script it to spawn different objects based on the item I think.
You can probably get the item used for casting the spell with GetCastItem()

Code:
#include "ScriptPCH.h"
// possible spells:
// 27651, 897

class AOE_Placer_Script : public SpellScriptLoader
{
public:
    AOE_Placer_Script() : SpellScriptLoader("AOE_Placer_Script") { }

    class spell_AOE_Placer_Script : public SpellScript
    {
        PrepareSpellScript(spell_AOE_Placer_Script);

        void HandleAfterCast()
        {
            Item* item = GetCastItem();
            const WorldLocation* summonPos = GetExplTargetDest();
            if (!item || !summonPos || !GetCaster() || !GetCaster()->ToPlayer())
                return;
            uint32 objectId = 0;
            switch (item->GetEntry())
            {
                // item entry is 123, spawn object entry 345
            case 123: objectId = 345; break;
            case 435: objectId = 567; break;

            default:
                return;
            }

            SpawnObject(GetCaster()->ToPlayer(), objectId, summonPos);
        }

        void Register()
        {
            AfterCast += SpellCastFn(spell_AOE_Placer_Script::HandleAfterCast);
        }
    };

    static bool SpawnObject(Player* player, uint32 objectId, const WorldLocation* summonPos)
    {
        const GameObjectTemplate* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
        if (!objectInfo)
            return false;
        if (objectInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(objectInfo->displayId))
            return false;
        float x, y, z, o;
        summonPos->GetPosition(x,y,z,o);
        Map* map = player->GetMap();

        GameObject* object = new GameObject;
        uint32 guidLow = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT);

        if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
        {
            delete object;
            return false;
        }

        // fill the gameobject data and save to the db
        object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMaskForSpawn());

        // this will generate a new guid if the object is in an instance
        if (!object->LoadGameObjectFromDB(guidLow, map))
        {
            delete object;
            return false;
        }

        sObjectMgr->AddGameobjectToGrid(guidLow, sObjectMgr->GetGOData(guidLow));
        return true;
    }

    SpellScript* GetSpellScript() const
    {
        return new spell_AOE_Placer_Script();
    }
};

void AddSC_AOE_Placer_Script()
{
    new AOE_Placer_Script();
}
 
Last edited:

FoxGaming

Exalted Member
[MENTION=6]Rochet2[/MENTION]

Thank you very much, I really appreciate the help. I think i've got this figured out now :)
 

FoxGaming

Exalted Member
Please ignore the crappy modeling shown, i know why some models are half way under the map and some are not, it's not intentional, it's just forgetting about details at 3:00am, anyway I just wanted to show that there has been progress made, thanks to Rochet there is now spawning of objects in-game, i realize that I have some green blocks, which means i've messed up on the texture file at some point during the conversion process, You'll also notice that my glass is not see through, could very well be a client limitation or just my texture is not correct, I do have profession in the making as well, which will use the crafting table/furnace. You may have also noticed that there's custom item icons :)
Please excuse how boring it is, there's no sound or anything and I'm using crappy free cam software, i promise it looks better in-game lol

WoWScrnShot_090913_031042_zps608c45d6.jpg


I don't know when this will all be done, I leave for college in 3 days...the only time I have at the moment to work is to stay awake and not sleep, which explains all the petty mistakes that I would never make if i wasn't running on 0 sleep and staying awake to work on this. Professions will be coming soon as soon as I get the spawning issues out of the way.
[MENTION=6]Rochet2[/MENTION]
[MENTION=1]Tommy[/MENTION]

Do either of you know if there would be a way to replicate a type of snap to grid? or some sort of snapping option when spawning objects as shown in the video and screenshots it is hell to get things to line up, also you cannot put the cursor on top of the gameobject, i'm sure that's just something I'm overlooking...either way it's 3:15am i'm going to get some sleep lol
 

Tommy

Founder
Please ignore the crappy modeling shown, i know why some models are half way under the map and some are not, it's not intentional, it's just forgetting about details at 3:00am, anyway I just wanted to show that there has been progress made, thanks to Rochet there is now spawning of objects in-game, i realize that I have some green blocks, which means i've messed up on the texture file at some point during the conversion process, You'll also notice that my glass is not see through, could very well be a client limitation or just my texture is not correct, I do have profession in the making as well, which will use the crafting table/furnace. You may have also noticed that there's custom item icons :)
Please excuse how boring it is, there's no sound or anything and I'm using crappy free cam software, i promise it looks better in-game lol

WoWScrnShot_090913_031042_zps608c45d6.jpg


I don't know when this will all be done, I leave for college in 3 days...the only time I have at the moment to work is to stay awake and not sleep, which explains all the petty mistakes that I would never make if i wasn't running on 0 sleep and staying awake to work on this. Professions will be coming soon as soon as I get the spawning issues out of the way.

@Rochet2
@Tommy

Do either of you know if there would be a way to replicate a type of snap to grid? or some sort of snapping option when spawning objects as shown in the video and screenshots it is hell to get things to line up, also you cannot put the cursor on top of the gameobject, i'm sure that's just something I'm overlooking...either way it's 3:15am i'm going to get some sleep lol

In my opinion, you can just get the last position you spawned a gameobject and spawn something in that position with a higher Z value. Looks good so far.
 
Top