UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Questions about functions and the basic codes

broken avatar :(
Created 8 years ago
by niick555
0 Members and 1 Guest are viewing this topic.
3,165 views
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 8 June 2015
Last active: 7 years ago
Posts
38
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
niick555's Groups
niick555's Contact & Social Links
Good afternoon, all right?
I'm starting with the scripting right now and have several questions regarding some bases functions that I have not found anywhere, even in the scripting reference here from UGX... As an example, this excerpt below:

Code Snippet
Plaintext
level.DLC3 = spawnStruct(); // Leave This Line Or Else It Breaks Everything

What would be the "level" and what is the spawnStruct() function? Is there any place where I can find these references?

Thank you!
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Level is the same thing as a global. It exists everywhere and can be accessed whenever.

SpawnStruct allocates a certain amount of data for that specific variable, it's different from initializing it as an array. You might find a better description on the scripting reference here or on zeroys script reference.


broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 8 June 2015
Last active: 7 years ago
Posts
38
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
niick555's Groups
niick555's Contact & Social Links
Level is the same thing as a global. It exists everywhere and can be accessed whenever.

SpawnStruct allocates a certain amount of data for that specific variable, it's different from initializing it as an array. You might find a better description on the scripting reference here or on zeroys script reference.

I searched here in reference but did not find these functions: \

But thank you very much, helped a lot!
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Just to add onto what DidUKnowiPwn said:

Level is the same thing as a global. It exists everywhere and can be accessed whenever.

...however the things that you associate with it can only be accesses after they have been declared. Attempting to access the level variable(say level.DLC3) before it is declared will result in an undefined/uninitialized variable.

Quote
SpawnStruct allocates a certain amount of data for that specific variable, it's different from initializing it as an array. You might find a better description on the scripting reference here or on zeroys script reference.

To my understanding, spawnStruct() just spawns a script_struct. Meaning you can give it a targetname, script_noteworthy, or script_string and get it from in-game(it presumably spawns at (0, 0, 0).
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 7 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
Signature
×
liamsa669's Groups
liamsa669's Contact & Social Links
I searched here in reference but did not find these functions: \

But thank you very much, helped a lot!
there are aton of functions that arent engine based, those are the ones that tend to not show up in refrences. I just recommend looking at the #includes' files. they usually contain the functions that arent server based... actually they DO contain
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 8 June 2015
Last active: 7 years ago
Posts
38
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
niick555's Groups
niick555's Contact & Social Links
there are aton of functions that arent engine based, those are the ones that tend to not show up in refrences. I just recommend looking at the #includes' files. they usually contain the functions that arent server based... actually they DO contain

Just to add onto what DidUKnowiPwn said:

...however the things that you associate with it can only be accesses after they have been declared. Attempting to access the level variable(say level.DLC3) before it is declared will result in an undefined/uninitialized variable.

To my understanding, spawnStruct() just spawns a script_struct. Meaning you can give it a targetname, script_noteworthy, or script_string and get it from in-game(it presumably spawns at (0, 0, 0).

Many thanks for the tips! I have one more question... When I have to change any original file, for example the archives of folder raw/maps, as _zombiemode_perks.gsc to change the perks... How should I do? Why give not change all game maps? Or should I edit another file?
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
If you want to override any non-DLC3 map you're going to have use its script as you should be on DLC3 mod tools. Whenever you want to edit an existing file for only a specific map/mod you'll have to copy that file and it's location (I.e. Raw/Maps/_zombiemode_perks.gsc would go in mod/modname/maps/_zombiemode_perks.gsc, NOTE: may not apply to all asset types such as fonts, fonts lose their inner folder).
broken avatar :(
×
broken avatar :(
Location: hkHong Kong
Date Registered: 26 August 2012
Last active: 7 years ago
Posts
17
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
JustForFun119's Groups
JustForFun119's Contact & Social LinksJustForFun119
I think the spawnStruct() function can be thought as a C-style structure data; even easier to use.

Code Snippet
Plaintext
stats = spawnStruct();
stats.boxPulls = 0;
playerVariable.statTrack = stats;
'playerVariable.boxPulls' -> 0

It is used in some _zombiemode_*.gsc scripts, a lot in Black Ops gsc.
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 8 June 2015
Last active: 7 years ago
Posts
38
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
niick555's Groups
niick555's Contact & Social Links
If you want to override any non-DLC3 map you're going to have use its script as you should be on DLC3 mod tools. Whenever you want to edit an existing file for only a specific map/mod you'll have to copy that file and it's location (I.e. Raw/Maps/_zombiemode_perks.gsc would go in mod/modname/maps/_zombiemode_perks.gsc, NOTE: may not apply to all asset types such as fonts, fonts lose their inner folder).

I think the spawnStruct() function can be thought as a C-style structure data; even easier to use.

Code Snippet
Plaintext
stats = spawnStruct();
stats.boxPulls = 0;
playerVariable.statTrack = stats;
'playerVariable.boxPulls' -> 0

It is used in some _zombiemode_*.gsc scripts, a lot in Black Ops gsc.

Now I understand better, thank you everyone!

 
Loading ...