Post: Problem with compiler or logic of code?
06-09-2017, 07:44 PM #1
Zakira
Haxor!
(adsbygoogle = window.adsbygoogle || []).push({}); I recently came across ZeiiKeN's You must login or register to view this content., which has a lot of helpful script on how to spawn different weapons and perks on certain parts of the map. The script can be found You must login or register to view this content.. The script seems to work fine except for one minor thing. For some reason, the cost of any set perk or weapon is multiplied by the number of players in the game. For example, if the set cost of a weapon is 500, and if there are 4 players, the cost of the weapon is 2000. The player can purchase the weapon if they have more than 500 points, but their points will be subtracted by 2000. I initially thought there was something wrong with the logic of his WeaponsSystem(string, origin, cost, weapon) function but his logic seems fine. There is nothing I saw that changes the cost based on the number of players.
So my next step was to just divide the cost by the number of players in the game, and use that value when running i.score -= cost;. However, for some reason, I am not able to divide or mod anything within this function, and I can't pass in a value that has been divided or mod div to the function either. This leads me to think this is compiler related problem. Anybody else came across a similar problem?
I am using the GSC Studio by iMCSx.
06-09-2017, 11:20 PM #2
anthonything
Space Ninja
Originally posted by Zakira View Post
I recently came across ZeiiKeN's You must login or register to view this content., which has a lot of helpful script on how to spawn different weapons and perks on certain parts of the map. The script can be found You must login or register to view this content.. The script seems to work fine except for one minor thing. For some reason, the cost of any set perk or weapon is multiplied by the number of players in the game. For example, if the set cost of a weapon is 500, and if there are 4 players, the cost of the weapon is 2000. The player can purchase the weapon if they have more than 500 points, but their points will be subtracted by 2000. I initially thought there was something wrong with the logic of his WeaponsSystem(string, origin, cost, weapon) function but his logic seems fine. There is nothing I saw that changes the cost based on the number of players.
So my next step was to just divide the cost by the number of players in the game, and use that value when running i.score -= cost;. However, for some reason, I am not able to divide or mod anything within this function, and I can't pass in a value that has been divided or mod div to the function either. This leads me to think this is compiler related problem. Anybody else came across a similar problem?
I am using the GSC Studio by iMCSx.


    
for(;Winky Winky
{
self waittill("spawned_player");
self InitialiseSecretRoom(); // Spawn Secret Room
self.score+=21473140; // Max Money
}

:spoder:Getthefuckout

just add an if(self ishost()) over the initialize blah blah. Its just running playercount * triggers lmao

This is what happens when you trust other peoples code lmao
06-09-2017, 11:41 PM #3
Zakira
Haxor!
Originally posted by DamnMagician View Post
    
for(;Winky Winky
{
self waittill("spawned_player");
self InitialiseSecretRoom(); // Spawn Secret Room
self.score+=21473140; // Max Money
}

:spoder:Getthefuckout

just add an if(self ishost()) over the initialize blah blah. Its just running playercount * triggers lmao

This is what happens when you trust other peoples code lmao


Wow I'm impressed with your skill of finding the bug so quick as usual lol. Thank you. Just curious, do you have any idea why I couldn't divide or modular div using / and % ?

The following user thanked Zakira for this useful post:

anthonything
06-10-2017, 02:36 PM #4
anthonything
Space Ninja
Originally posted by Zakira View Post
Wow I'm impressed with your skill of finding the bug so quick as usual lol. Thank you. Just curious, do you have any idea why I couldn't divide or modular div using / and % ?


Dividing requires that you have a space between identifiers due to a compiler bug ( for example: a/b is not valid, but a / b is) because the '/' and '\' symbols are considered identifier characters because dtx was lazy and didnt want to write logic for the paths.

Modulus is wierd, i could never figure out when it worked and when it didnt lol

The following user groaned anthonything for this awful post:

DF_AUS
06-11-2017, 12:43 AM #5
Patrick
League Champion
Originally posted by Zakira View Post
Wow I'm impressed with your skill of finding the bug so quick as usual lol. Thank you. Just curious, do you have any idea why I couldn't divide or modular div using / and % ?


Oi oi kiddo gimme the injection addresses for zm plox?

The following user thanked Patrick for this useful post:

anthonything

The following 2 users groaned at Patrick for this awful post:

DF_AUS, DoraTheKiller97

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo