JK2MV API - how to use it?

Discussions about modding, questions, mod requests or just show off what you're working on.
Post Reply
barryhit
Posts: 8
Joined: 29 Feb 2016, 07:56

JK2MV API - how to use it?

Post by barryhit »

Hi

I've been trying to utilize jk2mv's snapshotIgnore in my [1.02] server-side mod, but can't get it working.

I've put #include for mvapi.h into g_local.h, mvsharedEntity_t *mvEnts into g_main.c, trap_MVAPI_LocateGameData under G_Init and in g_utils.c, the new syscall for my .qvm in g_syscalls.asm

then I call for the function in g_cmds.c with:

Code: Select all

void Cmd_SnapshotIgnore_f
{
mvsharedEntity_t *target = mvEnts[1]; // in this case, client 1 is the target

 target->snapshotIgnore[2]; // trying to make client 2 not broadcast
 }

Now for some reason I can't get it to work. I asked about this before from Daggolin on skype, but I already forgot the issue. Tips, anyone?
[/color]
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: JK2MV API - how to use it?

Post by Daggolin »

Code: Select all

target->snapshotIgnore[2] = qtrue;
barryhit
Posts: 8
Joined: 29 Feb 2016, 07:56

Re: JK2MV API - how to use it?

Post by barryhit »

Ok..now the compiler gives me the error 'operands of = have illegal types 'pointer to mvsharedEntity_t' and 'mvsharedEntity_t'

I've declared mvEnts as:

Code: Select all

mvsharedEntity_t 	mvEnts[MAX_GENTITIES]; in g_main.c 

and 

trap_MVAPI_LocateGameData( (mvsharedEntity_t *)mvEnts, level.num_entities, sizeof( mvsharedEntity_t ) );
am I missing something?
Thanks!
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: JK2MV API - how to use it?

Post by ouned »

learn C first before messing with real stuff^^
barryhit
Posts: 8
Joined: 29 Feb 2016, 07:56

Re: JK2MV API - how to use it?

Post by barryhit »

ouned wrote:learn C first before messing with real stuff^^
k.. good point :D..learning while doing :P
Kevin
Administrator
Posts: 393
Joined: 07 Jun 2015, 08:36

Re: JK2MV API - how to use it?

Post by Kevin »

barryhit wrote:
ouned wrote:learn C first before messing with real stuff^^
learning while doing :P
Best way to learn ;) Starting off with the JK2MV API might just be a bit too much to start off with :)
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: JK2MV API - how to use it?

Post by ouned »

by the way:
https://github.com/mvdevs/jk2mv/wiki/API-Overview
but the feature you are using is undocumented (blame Daggolin)
barryhit
Posts: 8
Joined: 29 Feb 2016, 07:56

Re: JK2MV API - how to use it?

Post by barryhit »

missed that .. no problem, guess it's easier to code other original features instead
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited
 

 

cron