Extending an existing (stripped) package

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2802
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Extending an existing (stripped) package

Post by Barbie »

I want to extend the existing package "MapVoteULv1_2" and override the function KickPlayer() there.
The command line for compiling is

Code: Select all

%UTDIR%\System\ucc.exe make ini=%PROJECT_SRCCODE_MAKEFILE%
File "MapVoteULv1_2.u" exists in path "%UTDIR%\System\"
%PROJECT_SRCCODE_MAKEFILE%

Code: Select all

[Engine.Engine]
EditorEngine=Editor.EditorEngine

[Editor.EditorEngine]
CacheSizeMegs=128
EditPackages=UnrealShare
EditPackages=MapVoteULv1_2
EditPackages=SBMapVoteV0

[Core.System]
Paths=../System/*.u
Paths=../Maps/*.unr
Paths=../Textures/*.utx
Paths=../Sounds/*.uax
Paths=../Music/*.umx
Paths=../System/3rd/*.u
Paths=../Maps/3rd/*.unr
Paths=../Textures/3rd/*.utx
Paths=../Sounds/3rd/*.uax
Paths=../Music/3rd/*.umx
SBMapVote.uc

Code: Select all

// enabling the next line does not change anything:
//#exec obj load file=MapVoteULv1_2

class SBMapVote extends BDBMapVote;

function KickPlayer(int PlayerID, string PlayerName) {}
UCC.EXE says:
=======================================
ucc.exe: UnrealOS execution environment
Copyright 1999 Epic Games Inc
=======================================

--------------------UnrealShare--------------------
--------------------MapVoteULv1_2--------------------
--------------------SBMapVoteV0--------------------
Analyzing...
Superclass BDBMapVote of class SBMapVote not found

History:

Exiting due to error
Last edited by Barbie on Fri Jul 22, 2022 6:13 pm, edited 1 time in total.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Buggie
Godlike
Posts: 2733
Joined: Sat Mar 21, 2020 5:32 am

Re: Extending an existing (stripped) package

Post by Buggie »

You can not compile against stripped package.

This is why (just +1 reason more) source MUST be included. :mad2:

But you can create dumb placeholder package (stub) with possible implementation on it, compile against it, cross fingers and hope it work.

So you goes into UnrealEd. Make there somewhere class BDBMapVote, put it into package MapVoteULv1_2 (previously remove original one), place empty function KickPlayer, compile, save package, and use it as placeholder for compile against it.
User avatar
Deepu
Adept
Posts: 353
Joined: Mon Nov 11, 2013 7:56 am
Personal rank: Average
Location: India
Contact:

Re: Extending an existing (stripped) package

Post by Deepu »

I will share the source, don't worry
Buggie
Godlike
Posts: 2733
Joined: Sat Mar 21, 2020 5:32 am

Re: Extending an existing (stripped) package

Post by Buggie »

Here it with sources:
It slightly edited and conformed with original.

Changes:
- If MapListIfNooneVoted is zero then choose goes from all lists
- if MapListIfNooneVoted negative, then choose goes from all lists expect this one mentioned.
- RandomMapName specify substring for search and detect random map item.
- When used RandomMapName for vote, on won show exact map name instead.
- When used RandomMapName for vote, not happen bug with "server close connection" on server travel.

I think for your setup need change
MapListIfNooneVoted to -4.
RandomMapName you can keep as default value "(a random map)".

I use this map vote on VCTF, but in uz I left old version. So this not make troubles when travel among servers even if someone else also modify and conform package.

Automatically merged

And OFC you can compile own modules against this package and on server use old package with stripped sources, if you want so.

*** attachment removed, since it break net play ***
Last edited by Buggie on Sat May 13, 2023 4:03 pm, edited 2 times in total.
User avatar
Deepu
Adept
Posts: 353
Joined: Mon Nov 11, 2013 7:56 am
Personal rank: Average
Location: India
Contact:

Re: Extending an existing (stripped) package

Post by Deepu »

Original SRC:
MVUv1_2_Source.zip
(199.32 KiB) Downloaded 5 times
Post Reply