LUA, server API, etc

"eventually EUO will get to the point its (sic) unplayable" - Dudle

Moderator: EUO Moderators

Re: LUA, server API, etc

Postby Rumper » Mon Oct 30, 2017 8:50 am

FIrst link in the first post is dead :(
User avatar
Rumper
I used to bake rockcakes in my bakery.
 
Posts: 181
Joined: Sun Jan 25, 2015 11:49 pm

Re: LUA, server API, etc

Postby eggmceye » Wed Nov 01, 2017 9:16 pm

updated:
http://swut.net/files/eao.pkg.cpp

still the worst documented api in teh world

and in case anyone didn't realise, this is same api as for EftV single player version, in case you felt like hacking/modding it
User avatar
eggmceye
hello
 
Posts: 9882
Joined: Mon Mar 11, 2002 3:55 pm
Location: Sydney, Australia

Re: LUA, server API, etc

Postby LaughingCoyote » Mon Jan 29, 2018 8:58 am

Is there a complete item code list somewhere? Trying to find the item code for greater yellow potions in the euo>dat> .txt files and can't find it.
Hecate wrote: I feel even more evil than ever, milking cows before killing them.

eggmceye wrote:pretty cool having vigour put in the manual after 14 years X-D
User avatar
LaughingCoyote
Girls only want boyfriends who have great skills.
 
Posts: 787
Joined: Fri Jan 02, 2004 10:30 pm

Re: LUA, server API, etc

Postby LordMortiferus » Mon Jan 29, 2018 5:16 pm

LC you are on the right track looking through the dat folder.
As stated in other.txt 0x104 is the base item code for yellow pots. If I am not mistaken 0x3f0104 would be for greater pots
0x1f0104 improved
0x2f0104 refined
0x3f0104 greater

Same goes for blue pots (0x105), heck you can make any item greater adding 0x3f0.
User avatar
LordMortiferus
Girls only want boyfriends who have great skills.
 
Posts: 759
Joined: Tue Dec 01, 2009 10:23 pm

Re: LUA, server API, etc

Postby EmoMage » Mon Jan 29, 2018 6:12 pm

that's neat
eggmceye wrote:
ParadoxOfChoice wrote:Zombie using bow/sling probably shouldn't give disease.

the zombies are pulling the arrows out of their ass
User avatar
EmoMage
Posting from my ass computer.
 
Posts: 617
Joined: Tue Aug 06, 2013 10:10 am

Re: LUA, server API, etc

Postby LordMortiferus » Sat Feb 10, 2018 10:35 pm

Max: do we have or could you add an API-function to play existing wavefile SFX via LUA?
User avatar
LordMortiferus
Girls only want boyfriends who have great skills.
 
Posts: 759
Joined: Tue Dec 01, 2009 10:23 pm

Re: LUA, server API, etc

Postby eggmceye » Sun Feb 11, 2018 11:36 am

depends on the wav file

There is no existing mechanism for the server to make the client play a wav on it's own. What there is is the event system which could be exploited potentially without mods (I'll find out after writing this para). Events are either sound fx or visual fx and are non essential -ie if the client dropped all the event packets it wouldn't matter.

As far as the API goes, there are 2 funcs: send_event and simple_send_event. the latter uses less params and was written for lua in mind.

if your sound was used by one of the events in enum event_nums,
Code: Select all
enum event_nums {

   EVENT_STEP=0,
   EVENT_MAGIC,
   EVENT_HIT,
   EVENT_MISS,
   EVENT_QUAKE1,
   EVENT_QUAKE2,
   EVENT_MISSLE,
   EVENT_TRAP,
   EVENT_GUN,
   EVENT_LASER,
   EVENT_HIT2,
   EVENT_WHIT,
   EVENT_TELE,
   EVENT_TELEFRAG,
   EVENT_FDEATH,
   EVENT_MDEATH,
   EVENT_WDEATH,
   EVENT_BLOCKED,
   EVENT_PARRIED,
   EVENT_RIPOSTE,
   EVENT_PORTAL_UP,
   EVENT_PORTAL_DOWN,
   EVENT_STEAL,
   EVENT_SHOOT, // not gun!
   EVENT_THUNDERCLAP,
   EVENT_CRITICAL,
};


you could just use send_event to send that, eg
Code: Select all
send_event(z, -1, x, y, EVENT_STEAL, 0) -- 0 at the end is the event subtype

subtype is only used by magic (it is the spell#) and missiles and splats

if you wanted to play a spell sound then you would have to send the magic event, but that would also show the visual fx. If you wanted just the spell sound, which is a good idea, then I would have to come up with a mod for that to happen
User avatar
eggmceye
hello
 
Posts: 9882
Joined: Mon Mar 11, 2002 3:55 pm
Location: Sydney, Australia

Re: LUA, server API, etc

Postby LordMortiferus » Sun Feb 11, 2018 4:35 pm

Thanks for the detailed informations.
EVENT_GUN should be what I was looking for.
send_event(z,-1,x,y,EVENT_MISSLE,MISSLE_BULLET,rx,ry)
send_event(z, -1, x, y, EVENT_GUN, 0)
User avatar
LordMortiferus
Girls only want boyfriends who have great skills.
 
Posts: 759
Joined: Tue Dec 01, 2009 10:23 pm

Re: LUA, server API, etc

Postby LordMortiferus » Sun Feb 11, 2018 5:38 pm

EVENT_GUN is for pistole/guns SFX
EVENT_SHOOT is for bows/crossbows SFX

What about slings and throwing axes SFX?
User avatar
LordMortiferus
Girls only want boyfriends who have great skills.
 
Posts: 759
Joined: Tue Dec 01, 2009 10:23 pm

Previous

Return to EUO Development

Who is online

Users browsing this forum: No registered users and 3 guests