EOSERV Forum > EO Server Building > Question about range weapons
Page: << 1 >>
Question about range weapons
Author Message
Post #203016 Question about range weapons

is there a way I can have different range for different weapons like in my game folder I see where I can set the range weapons its on 5 tiles by default but I want some weapons to have range 2 an progress as you go

7 years, 5 weeks ago
Post #203017 Re: Question about range weapons

You using Eoserv? I have this from an old rev:

In the Map::Attack function, find:

if (wepdata.subtype == EIF::Ranged)

{

range = static_cast<int>(this->world->config["RangedDistance"]);

}

then add this under it:

if(this->world->config["WeaponEffects"])

    {

        for(int i = 1; i<= static_cast<int>(this->world->config["WeaponEffectAmount"]); i++)

        {

            int wep = static_cast<int>(this->world->config[util::to_string(i)+".WepEffID"]);


            if(wep == from->paperdoll[Character::Weapon])

            {

                if(static_cast<int>(this->world->config[util::to_string(i)+".WepEffRange"]) > 0)

                {

                    range = static_cast<int>(this->world->config[util::to_string(i)+".WepEffRange"]);

                    break;

                }

            }

        }

    }

I'm sure this can be shortened/made more efficient but it's an old code and worked for me

7 years, 5 weeks ago
Post #203018 Re: Question about range weapons

Nice example Callum!

---
Just your friendly neighborhood Programmer-Man!
7 years, 5 weeks ago
Post #203019 Re: Question about range weapons

You could go the pub route in eodata.hpp

in template <class EIF> struct EIF_Data_Base

under short armor;

add unsigned char unkb;

a little lower find armor(0),

add unkb(0),


in eodata.cpp

in void EIF::Read(const std::string& filename)

under newdata.armor = PacketProcessor::Number(buf[17], buf[18]);

add newdata.unkb = PacketProcessor::Number(buf[19]);


in map.cpp

in void Map::Attack(Character *from, Direction direction)

replace if (wepdata.subtype == EIF::Ranged)
    {
        range = static_cast<int>(this->world->config["RangedDistance"]);


with if (wepdata.subtype == EIF::Ranged)
    {
        range = (wepdata.unkb  ? wepdata.unkb : static_cast<int>(this->world->config["RangedDistance"]);static_cast<int>(this->world->config["RangedDistance"]));


Then in your eif file set the unkb value to the distance you want that ranged wep to be!

7 years, 5 weeks ago
Post #203028 Re: Question about range weapons

darn theres so much to this game I have no clue about lol thanks though. But honestly I don't know where to even start to do that. an I'm using eosouce

7 years, 5 weeks ago
Post #203423 Re: Question about range weapons
Plako posted: (22nd Mar 2017, 01:56 pm)

darn theres so much to this game I have no clue about lol thanks though. But honestly I don't know where to even start to do that. an I'm using eosouce


Honestly...switch to Eoserv it's, still being developed, Sasauge an the others are still around to help etc. Eosource is kinda hacky, not even supported by the developers you'll have a better time with eoserv just my two cents bud good luck :)
6 years, 43 weeks ago
Page: << 1 >>

EOSERV Forum > EO Server Building > Question about range weapons