Fortnite Script Help!! [XB1]
19 posts
• Page 1 of 2 • 1, 2
Fortnite Script Help!! [XB1]
I'm trying to make a script that will track when I'm in build mode or combat mode as well as which slot I'm currently using so no matter where I'm at in the "menu" it will recognize what it takes to get to a certain slot so when I hit 1 for example it will bring me back to combat mode slot 1 even if I was in build mode. All I can think of is a crazy amount of if statements but that seems highly inefficient I'm fairly new to coding so if anyone has any ideas they would be highly appreciated
-
DeathFear - Sergeant
- Posts: 8
- Joined: Thu Jan 25, 2018 5:22 pm
Re: Fortnite Script Help!! [XB1]
I started the script (my first one ever) and I'm having troubles with getting the value of the shortest distance between the current selected slot (wepslottrack/bldslottrack) and the requested slot, so lets say I'm on slot 4 and I want to go to slot 1 the most efficient path is hitting RB twice so I circle around back to 1 but how would I go about getting that value in code. I could code a bunch of if statements for every situation but that would be a lot of unnecessary code.
Any feedback is appreciated!!
Any feedback is appreciated!!
- Code: Select all
//mode and tracker
define buildmode = 1;
define combatmode = 0;
int mode = combatmode;
//weapon hotkeys and tracker
int wslot1 = 1;
int wslot2 = 2;
int wslot3 = 3;
int wslot4 = 4;
int wslot5 = 5;
int wepslottrack=1;
//building hotkeys and tracker
int bslot1;
int bslot2;
int bslot3;
int bslot4;
int bldslottrack=1;
main {
//keeps track of which mode
if ((event_press(XB1_B)) && (mode == combatmode)) {
mode = buildmode
}
else if ((event_press(XB1_B)) && (mode == buildmode)) {
mode = combatmode;
}
//keeps track of weapon slot
if ((event_press(XB1_RB)) && (mode == combatmode)) {
wepslottrack = wepslottrack + 1
if (wepslottrack > 5) {
wepslottrack = 1
}}
if ((event_press(XB1_LB)) && (mode == combatmode)) {
wepslottrack = wepslottrack - 1
if (wepslottrack < 1) {
wepslottrack = 5
}}
//keeps track of build slot
if ((event_press(XB1_RB)) && (mode == buildmode)) {
bldslottrack = bldslottrack + 1
if (bldslottrack > 4) {
bldslottrack = 1
}}
if ((event_press(XB1_LB)) && (mode == buildmode)) {
bldslottrack = bldslottrack - 1
if (bldslottrack < 1) {
bldslottrack = 4
}}
//switches to requested slot
if (event_press(CEMU_EXTRA1)) {
combo_run(weapon1)
}
if (event_press(CEMU_EXTRA2)) {
combo_run(weapon2)
}
if (event_press(CEMU_EXTRA3)) {
combo_run(weapon3)
}
if (event_press(CEMU_EXTRA4)) {
combo_run(weapon4)
}
if (event_press(CEMU_EXTRA5)) {
combo_run(weapon5)
}
if (event_press(CEMU_EXTRA6)) {
combo_run(buildwall)
}
if (event_press(CEMU_EXTRA7)) {
combo_run(buildstair)
}
//manual tracker reset to weapon mode slot1
if (event_press(XB1_RIGHT)) {
mode = 0
wepslottrack = 1
bldslottrack = 1
}
}
combo weapon1 {
}
combo weapon2 {
}
combo weapon3 {
}
combo weapon4 {
}
combo weapon5 {
}
combo buildwall {
}
combo buildstair {
}
-
DeathFear - Sergeant
- Posts: 8
- Joined: Thu Jan 25, 2018 5:22 pm
Re: Fortnite Script Help!! [XB1]
As for your first script you did very well. There is one or two possible optimizations, but in general it is very well structured.
Related with Fortnite, I can't really be of much help, have not played this game yet.
Related with Fortnite, I can't really be of much help, have not played this game yet.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Fortnite Script Help!! [XB1]
I tried to create a script like that aswell. Maybe we can work together. In the script you posted, at the beginning you defined build mode as 1,i guess because you start without a weapon, but when you defined it as 1 and later the code says : if buildmode is 1 and press b, weapon mode is 1, so you are always in weapon mode. Also you say mode=weapon mode at the beginning. So Mode will always be weapon mode. Sorry im writing from phone now I'll post my try for this script later.
-
Abaybay - Corporal
- Posts: 5
- Joined: Sun Jan 28, 2018 3:02 pm
Re: Fortnite Script Help!! [XB1]
Also, how are you going to keep track of how many weapon slots are actually filled?
with building it's easy as there are always 4 slots always available to use, but with weapons, 2 slots could be filled or 4, how are you going to determine this?
with building it's easy as there are always 4 slots always available to use, but with weapons, 2 slots could be filled or 4, how are you going to determine this?
-
MAL8010 - Sergeant Major of the Army
- Posts: 263
- Joined: Sun Feb 05, 2017 3:12 pm
Re: Fortnite Script Help!! [XB1]
Abaybay wrote:I tried to create a script like that aswell. Maybe we can work together. In the script you posted, at the beginning you defined build mode as 1,i guess because you start without a weapon, but when you defined it as 1 and later the code says : if buildmode is 1 and press b, weapon mode is 1, so you are always in weapon mode. Also you say mode=weapon mode at the beginning. So Mode will always be weapon mode. Sorry im writing from phone now I'll post my try for this script later.
This is my first script ever so im not entirely sure how placement affects the outcome of the code, but i had the tracker working (i checked it by getting the value of bldslottrack and wepslottrack and set them to the paddle buttons on the xbox so i could see what the values were) the problem was when the code input a button,lets say the code hit RB, the tracker wouldnt recognize that RB was hit so the tracker wouldnt be in the correct spot anymore and im not sure how to fix that. any ideas?
-
DeathFear - Sergeant
- Posts: 8
- Joined: Thu Jan 25, 2018 5:22 pm
Re: Fortnite Script Help!! [XB1]
MAL8010 wrote:Also, how are you going to keep track of how many weapon slots are actually filled?
with building it's easy as there are always 4 slots always available to use, but with weapons, 2 slots could be filled or 4, how are you going to determine this?
i didnt think of this problem actually but i put in a manual tracker reset so if anything went wrong with the tracker and it thought you were in a different spot in your modes than you actually were you could put your character back to holding the first weapon and hit the reset so the tracker would be in sync again. i dont have a better solution than that because theres no way the code could "know" how many weapons you have. well... if you put in a system to track how many weapons youve picked up and which slots youve moved them to then its possible but for that you would need a crazy amount of if statements and separate keybindings for opening doors and picking up weapons its just not worth the trouble haha
-
DeathFear - Sergeant
- Posts: 8
- Joined: Thu Jan 25, 2018 5:22 pm
Re: Fortnite Script Help!! [XB1]
your script are working?
-
xLuckyX94 - Sergeant First Class
- Posts: 22
- Joined: Fri Dec 22, 2017 11:18 am
Re: Fortnite Script Help!! [XB1]
i Tried using this script i keep getting a error "define"
sorry im a nood
sorry im a nood
-
derekdorks - Private
- Posts: 1
- Joined: Sun Feb 25, 2018 2:52 am
Re: Fortnite Script Help!! [XB1]
derekdorks wrote:i Tried using this script i keep getting a error "define"
sorry im a nood
if you are trying to use this code with the Titan Two, include the following line at the very beginning of the script:
- Code: Select all
#include <titanone.gph>
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
19 posts
• Page 1 of 2 • 1, 2
Return to GPC1 Script Programming
Who is online
Users browsing this forum: No registered users and 81 guests