HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

VD&D DM/Player Roleplay

09-04-2008, 09:32 AM#1
Titanhex
I've been working on a heavy modification to Vuen's Dungeon and Dragon's which was released in 2005. I have the .sql, and have been working on this map for a month, making substantial headway. Unfortunately I've been working alone, and it's been a long road. I know if I want this project to be finalized and released, I'll need those more skilled than I am. If I can get that, the release should be quick and easy.

I come to WC3Campaigns knowing that the top skill lurks here, hoping to grab a bit of aid to add to the map credits.

Quote:
This was originall by Vuen, It was later modded by Blackroots, then Spiritman0. I furthered it with the tools it needed to compete with SotDRP. It now boasts a 'skilladd function, DM player units, a larger amount of custom models and skins, Jass spells, more items, the ability to give heroes directly to players, and DM activation on blue by name for certain people who have helped me.

Along with the ability to add skills, I have set many, many applicable unit skills to up level 10. As well there are "Blank" heroes who start off with no skills, allowing DMs to give them custom skill sets and set their skill level rate. The skill level of hero skills is now 5/5/5/3, maxing them out at 24.

An 'abilitylist is available for custom skills and spells. As well, the units and doodads have been updated so you can type their names to create them. All of this was done by manipulating the Jass code inside, which was a learning experience.

This version is a working version, though in a beta state. It is protected, and available for public use. Be aware that it is a Beta map, and does have a chance of criticaling or not doing what you except it to do.

The only versions that will be placed up here on Hive are for BetA testing, until I release a version that I believe can be played without worry of critical error by the entire VD&D community.

I'm looking for anyone well versed in Jass and GUI triggering to gander at the coding and perhaps formulate a less consuming 'skilladd code. If you're up to it, contact me and I'll provide you with the things you need and assist you with the repetitive work on the project.

Contact me at [email protected], PM, or over this thread.

Taken from my map submission at The Hive Workshop.

As well, a piece of the 'skilladd code is provided in Jass tags. I'll explain why.

I'm seeking well versed Jass coders and Trigger designers. The current Jass script for the 'skilladd function is ~8000 lines long, WAY too much. It causes medium lag, high load time, and has flaws such as over leveling causes the skill to stop working until you delevel it.

What isn't shown is how I hide it from the game chat, the entirity of the code, and several other pieces. It's just a general idea. I'll provide the real code in entirity if I believe the person requesting it can help me, though the entire code shouldn't be necessary.

So, the code is similar to SotDRP, but it's nowhere near as efficient.

I really need someone to give me a better template for skill add. Any and all repetitive work I'll gladly do myself, while giving anyone willing to help me full credit. Along with credit, I'll also give you an unprotected version of the map should you wish to help me in any other way.

I also could use spell makers, modelers, and texturers in that order.

On top of that, I need BetA testers and trustworthy people willing to help me with the work that needs done.

I'm quiet easy to work with, and will carry most all the work load. I'm capable of reducing file and model sizes, and many other various things.

The map is looking to be very promising, and I have an excited community waiting to recieve it. I could see this edition stimulating the life of Vuen's D&D, and perhaps even allowing it to compete with SotDRP.

So, contact me about helping, and we'll go from there.

Below is the run down of the Jass script in simplified form. This is the best way to see how the 'skilladd function I have implemented works.

Collapse JASS:
//This is where it actually adds the skill, levels it, etc.
function AddDefend takes nothing returns nothing
    if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then 
        call UnitAddAbilityBJ( 'Adef', GetEnumUnit() )
    endif
endfunction
function RemoveDefend takes nothing returns nothing
    if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then
        call UnitRemoveAbilityBJ( 'Adef', GetEnumUnit() )
    endif
endfunction
function LevelDefend takes nothing returns nothing
    if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then 
        call IncUnitAbilityLevelSwapped( 'Adef', GetEnumUnit() )
    endif
endfunction
function DelevelDefend takes nothing returns nothing
    if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then
        call DecUnitAbilityLevelSwapped( 'Adef', GetEnumUnit() )
    endif
endfunction
//This recognizes the string you entered and decides what desired result you want done.
function DoSkillAddHU takes integer id returns boolean

    local group grp

    local player pl
    local force fp
    local string str
    local string text

    local integer utype

    local integer i1
    local integer i2
    local integer array ratios



    set pl = ConvertedPlayer(id)

    if not(IsPlayerInForce(pl, udg_Force[2])) then
//********************RETURN
            return false //not a command
    endif

    set fp = bj_FORCE_PLAYER[id-1]
    set str = StringCase(GetEventPlayerChatString(), false)
    

   if (str == "adddefend" or str == "'defend") then
        set udg_TEMP_Player = pl
        set grp = GetUnitsInRectAll(GetPlayableMapRect())
        call ForGroupBJ( grp, function AddDefend )
        call DestroyGroup(grp)
        call DebugCommand(str,id)
    elseif (str == "@defend" or str == "removedefend") then
        set udg_TEMP_Player = pl
        set grp = GetUnitsInRectAll(GetPlayableMapRect())
        call ForGroupBJ( grp, function RemoveDefend )
        call DestroyGroup(grp)
        call DebugCommand(str,id)
    elseif (str == "+defend" or str == "lvldefend") then
        set udg_TEMP_Player = pl
        set grp = GetUnitsInRectAll(GetPlayableMapRect())
        call ForGroupBJ( grp, function LevelDefend )
        call DestroyGroup(grp)
        call DebugCommand(str,id)
    elseif (str == "=defend" or str == "deleveldefend") then
        set udg_TEMP_Player = pl
        set grp = GetUnitsInRectAll(GetPlayableMapRect())
        call ForGroupBJ( grp, function DelevelDefend )
        call DestroyGroup(grp)
        call DebugCommand(str,id)
        endif

//********************RETURN
    return true //is a command


    
endfunction
    //Far above this is the actual chat functions which you cant see in this Jass  Ask me if you need it and I'll add it.
    //Hides the string from DM chat
    elseif GetBooleanAnd(SubStringBJ(str,1,1) == "'" or SubStringBJ(str,1,1) == "+"or SubStringBJ(str,1,1) == "@"or SubStringBJ(str,1,1) == "=", IsPlayerInForce(pl, udg_Force[2])) then
            //Get rid of that pesky space people like to add
        if (SubStringBJ(str,2,2) == " ") then
            set text = SubStringBJ(str,3,StringLength(str))
        else
            set text = SubStringBJ(str,2,StringLength(str))
        endif
    if DoSkillAddHU(id) then
endif

I also need help with implementing a play animation function, and I created a play SFX function similar to this (Plays things like Explosion, Abolish Magic, Defend, etc.) but haven't been able to get it to work.

This is what I'm looking at modding, and once complete the work will carry over to larger, more diversified maps.

Be a part of this great project, and have your name recognized by Battle.net players and respected in the RP community!

I'll likely change the name from VD&D TE to VD&D Grand Project.
09-08-2008, 09:26 PM#2
Anopob
Erm, quite a while ago I did make a wave trigger, it was like the common spawn except after every X seconds it would create Y units to a building's rally point. Might be useful is DMs wanted some sort of wave attack, or AoS kind of quest. Although this is in GUI, it could easily be converted to JASS and then revamped.

Sadly, I can't really help you anywhere else, besides testing (maybe a few triggers look over). Hoping for this project to succeed!
09-09-2008, 03:34 AM#3
Malf
Your add/remove/inc/dec system is horrible. I took the liberty of scripting you a cleaner and faster one.

Uses Vexorian's Table library and of course vJass.
Collapse JASS:
scope skillManipulator initializer init

    globals
        StringTable cache
    endglobals
    
    private function SkillManipulate takes nothing returns nothing
    local string s = SubString(GetEventPlayerChatString(),8,10)
    local string skill = SubString(GetEventPlayerChatString(), 12, StringLength(GetEventPlayerChatString()))
    local player p = GetTriggerPlayer()
        if s == "add" then
            //Add a skill
            if cache[skill] != 0 then
                call UnitAddAbility(YourUnit,cache[skill])
            endif
        elseif s == "rmv" then
            //Remove a skill
            if cache[skill] != 0 then
                call UnitRemoveAbility(YourUnit,cache[skill])
            endif
        elseif s == "inc" then
            //Increase skill level
            if cache[skill] != 0 then
                call IncUnitAbilityLevel(YourUnit,cache[skill])
            endif
        elseif s == "dec" then
            //Decrease skill level
            if cache[skill] != 0 then
                call DecUnitAbilityLevel(YourUnit,cache[skill])
            endif
        endif
    endfunction

    private function initcache takes nothing returns nothing
        set cache = StringTable.create()
        //DECLARE ABILITIES AND THEIR CORRESPONDING CODE
        set cache["defend"] = 'Adef' // Adds/removes/whatever the defend ability when the player types "'skill add defend"
        set cache["mycustomskill"] = 'A000' //Adds/removes/whatever your ability when the player types "'skill add mycustomskill"
    endfunction

    private function init takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer i = 0
        call initcache.execute()
        loop
            exitwhen i == 12
            call TriggerRegisterPlayerChatEvent(t,Player(i),"'skill ",false)
            set i = i+1
        endloop
        call TriggerAddAction(t,function SkillManipulate)
    endfunction

endscope

That's 52 lines of code, 1 line for each ability you declare(I will explain this later). That's quite an improvement from 8000+ lines isn't it.

What it does is store integers(ability rawcodes) and label them with a corresponding name. Then a trigger detects if a player types " 'skill <operation> <ability label>" Where operation is "add" (add ability) / "rmv"(remove ability) / "inc" (increase level) / "dec" (decrease level) and ability label is the label of a stored ability rawcode.

Oh don't forget, YourUnit is only an example, change it to whatever unit you want to manipulate.

Tell me if something's wrong with the system.
09-25-2008, 03:14 PM#4
Titanhex
Woah, sorry about the long delay in a response. I'm far more active on Hiveworkshop.com. Because of the long delay I'll send a private message to you two. Alright, lets see.

Quote:
To Malf:
I like your 'skilladd system, as it seems far more efficient than my old system. However, Purple Poot, a moderator down at Hiveworkshop.com, has provided me with a code for skilladd that seems even more efficient.

Unfortunately, because I'm not too great at JASS, I'm having trouble grasping how to put it in my map. I'm more than willing to input all the repetitous raw code and manipulate it how I need to, but I can't do that until I, or someone else, figures out how it goes into the map.

I'll provide the code for anyone to sample here, and even provide an open link to my map if someone wants to attempt it. Of course credit will be given generously and rep added. I won't be able to get to the 'skilladd coding until the final parts of my map if I'm doing it myself, which is unfortunate because it's the part of the map I was the most excited about.

Quote:
To Anopob:
Actually that system sounds perfect! It would need to be activatable and deactivatable though. But not too long ago me and a fellow DM friend were discussing that a AoS type system would be highly useful in VD&D to create AoS type, DM controlled scenarios. If you think you can do it, talk to me and try it.
---

Here's the code provided by Purple Poot:

Quote:
Originally Posted by Purple Poot
This is a case in which a hash table makes the most sense.

Uses vJass/JassNewGenPack/whatever you want to call it.

Our hash table:
Collapse JASS:
library GC initializer init
    globals
        public gamecache hash
    endglobals
    private function init takes nothing returns nothing
        call FlushGameCache(InitGameCache("hash.w3v"))
        set hash = InitGameCache("hash.w3v")
    endfunction
endlibrary

Our trigger (should be in its own trigger category):
Collapse JASS:
scope OnChat
    private function Actions takes nothing returns boolean
        local string s = //ability string
        local unit u //u is the unit to add the spell to. In a loop, just have it be set constantly
        if HaveStoredInteger(GC_hash,"SpellRawcodes",s) then
            call UnitAddAbility(u,GetStoredInteger(GC_hash,"SpellRawcodes",s))
        endif
        //more stuff?
    endfunction

    public function InitTrig takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        loop
             exitwhen i > //MAX PLAYER ID
             call TriggerRegisterPlayerChatEvent(t,Player(i),"'skilladd ",false)
             set i = i + 1
        endloop
        call TriggerAddAction(t,function Actions)
    endfunction
endscope

scope SetupSpells
Collapse JASS:
    private function Actions takes nothing returns nothing
        call StoreInteger(GC_hash,"SpellRawcodes","flamestrike",'RAWC')
        //and so on
    endfunction
    public function InitTrig takes nothing returns nothing
        //go somehow
    endfunction
endscope

The thread can be found here:

http://www.hiveworkshop.com/forums/n...treply&t=97310

Unfortunately, the Manage Attachments wont allow me to upload the map for no apparent reason. So, I'll link you to the alternate on Hiveworkshop.com.
http://www.hiveworkshop.com/forums/r...Dlist%26r%3D20
Just to warn you, if you edit the map and save without the .sql it will make the cliffs permanently passable. However, you can edit the code and send me the map and I can just copy + paste, or you can send me a .txt of the triggers, or I can send you the .sql. The .sql is more complicated, but it's up to you.
09-26-2008, 12:09 AM#5
Anopob
Well then, here you go.
Wave Trigger 1


Trigger:
WAVE
Collapse Events
Player - Player 1 (Red) types a chat message containing wave as A substring
Player - Player 2 (Blue) types a chat message containing wave as A substring
Player - Player 3 (Teal) types a chat message containing wave as A substring
Player - Player 4 (Purple) types a chat message containing wave as A substring
Player - Player 5 (Yellow) types a chat message containing wave as A substring
Collapse Conditions
(Substring((Entered chat string), 1, 4)) Equal to wave
(Integer((Substring((Entered chat string), 6, 7)))) Less than or equal to 10
Collapse Actions
Set wave_unit[(Player number of (Triggering player))] = (Unit-type((Substring((Entered chat string), 9, (Length of (Entered chat string))))))
Set wave_integer[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 6, 7))))
Set wave_s_unit[(Player number of (Triggering player))] = (Random unit from (Units currently selected by (Triggering player)))


Wave Trigger 2


Trigger:
WAVE 2
Collapse Events
Time - Every 20.00 seconds of game time
Conditions
Collapse Actions
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of wave_s_unit[(Player number of (Picked player))]) Equal to (Picked player)
Collapse Then - Actions
Collapse For each (Integer A) from 1 to wave_integer[(Player number of (Picked player))], do (Actions)
Collapse Loop - Actions
Unit - Create 1 wave_unit[(Player number of (Picked player))] for (Picked player) at (Position of wave_s_unit[(Player number of (Picked player))]) facing Default building facing degrees
Unit Group - Add (Last created unit) to wave_group[(Player number of (Picked player))]
Collapse Unit Group - Pick every unit in wave_group[(Player number of (Picked player))] and do (Actions)
Collapse Loop - Actions
Unit - Order (Picked unit) to Attack-Move To (Rally-Point of wave_s_unit[(Player number of (Picked player))] as a point)
Unit Group - Remove all units from wave_group[(Player number of (Picked player))]
Else - Actions



Obviously, as I said, you will want to be converting these to JASS to make them fully efficient and all, but under my understanding and testing this should work. If the targetting unit doesn't have a rally point (because it isn't a building, obviously) then the units will just spawn beside the unit. Also, this only works on one unit, as I wanted to make sure it wasn't abusable. IIRC, it uses 4 udg variables, which again needs to be changed accordingly to however you wish to customize it. Give credits if it helps (though it basically follows the outline of a "spawn XX NAME" code.

For the activatable and deactivatable, you can do that I hope.
09-26-2008, 10:50 AM#6
Malf
PurplePoot's system only adds skills. Mine adds, removes, increments and decrements. :p
09-27-2008, 04:06 PM#7
Titanhex
Well, I am having a lot of trouble implementing purple poots system, and it does seem to overlook several keyfactors the map runs on. So, while implementing his system I'll also try implementing yours and see which runs better. I do like your system though, seems easier for me to use. I'll start implenting it now.

I assume it requires it's own trigger?
I do have one request on it though, if I may. Could you condense it or add it so that instead of a seperate inc/dec/add/remove it would be simply addinc/decrem. Like if the player types 'SUPERDEATHBOLT and they already have that skill, it simply levels up? I figure this would be far easier to thread rawcodes in to, and be more effiecent all around. I just wasn't sure how to do it at the time I made that code.
However, I also see that you've fully looked at my code and have done your best to imitate it's function while improving on it, which is awesome and appreciated! :)

and Anopob, thanks :3 I'll set it up whenever I can, and get it to work. The way it looks, an activate/deactivate switch shouldn't be hard. It looks very useful.

Is Vexorian's Table library xe.04? I'm not sure where to find it.

The first VD&D was made in pure World Editor. I think this is the first time JassNewGen has been used on it.
The old system use to use:
Collapse JASS:
        set grp = GetUnitsInRectAll(GetPlayableMapRect())
        call ForGroupBJ( grp, function DelevelDefend )
        call DestroyGroup(grp)
        call DebugCommand(str,id)

To choose the units to be modified, by modifying all units currently selected by the player. It's also how the system adds and removes things like HP/DAMAGE/Etc. It seems like it'd be easier for this system to also use some like that or that mimics it. I'm use to manipulating that coding, but not puting it in from the ground up, so bare with me.