Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Compass Script Idea

Author
Message
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 22nd Dec 2008 22:57 Edited at: 22nd Dec 2008 22:58
Hi all,
Have a look at this script



I was trying to make a compass which changes a hud each 45 degrees, ofcourse as usal it doesn't work
what's am doing wrong which is a lot probably..

PS: I have ply's mod

TY
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 23rd Dec 2008 22:23
anyone?
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 24th Dec 2008 09:04
Quote: ":state=2,vargreater=PlrAngel 0:state=10
:state=2,vargreater=PlrAngel 45:state=20
:state=2,vargreater=PlrAngel 90:state=30"


To debug things that run... but don't do waht they're supposed to. Come up with a scenario in your head and follow the script to see what it'll do.

Here's a scenario that probably doesn't do what you want it to do:

The player's angle is 91. Follow the code piece that I quoted.

The first check is if the angle is greater than 0.... which it is... so it goes to state 10... which probably isn't the right state.


And, a heads up for you.

Y angle is the angle that you'll be needing here. The Y-Angle is the angle of rotation around the Y-Axis, which is horizontal. X-Angle is the angle of rotation around the X-Axis, which is verticle.


Hope you get this working.


The one and only,


Avid
17
Years of Service
User Offline
Joined: 24th Jun 2007
Location:
Posted: 24th Dec 2008 14:47
He also spelt angle as ANGEL, which is gonna cause a whole heap of problems regardless.

Visit my site http://www.fpsmodels.com for models and media for fps creator.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 24th Dec 2008 22:14
Except "PlrAngel" is a variable that he declared. He can call his variables whatever he wants, as long as he's consistent with it.

One of Lee's variables in the source code was: (And it effectively did nothing for the source)
tusethisasweneeddoorstoblock

Some useless trivia for you all.


The one and only,


Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 24th Dec 2008 23:15
know i one more FPSC fact...thanks Plystire!

I know not with what weapons WWIII will be fought but WWIV will be fought with sticks and stones-Albert Einstein
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 25th Dec 2008 07:43
well is there a way to say when the angel is greater than 0 and less than 45?

TY
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 25th Dec 2008 13:19
nvm got it
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 07:54
ok lost it again, I made it very simple to keep track, just at 0 and 180 degrees still no signs of working



what am I doing wrong??????
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Dec 2008 11:13
I don't see much wrong with it...

Do the HUDs show up without you checking anything? Like, just make them show no matter what and see if they even appear.


The one and only,


Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 11:29
YES they do
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Dec 2008 11:59
Hmmm, then what is it doing? Are they just not showing up at all?


Try adding this to the bottom of your script:



That will make the value of "PlrAngel" appear in the top left corner of your screen while the game is running... which will help you determine what's going on.


The one and only,



Click Me, Please!
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 12:11
well I don't know why but the angel is always 0

I feel there's a stupid reason behind this where should I put the code? I put it in a trigger zone in the level..
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 12:26
news flash

NONE OF THE INTERNAL VARIABLES WORK

I tried $PH, $PL, $CPX, $CPY, $CPZ and lots of others, all show big (0)
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Dec 2008 12:53
Oops!! My bad, you need a "%" in front of the variable name there.


Here, use this line instead:



The "PrintVal" prints a value to the screen, so you need to make sure that you give it the variable's value by putting a % in front of it.


The one and only,



Click Me, Please!
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 13:35
well it partially worked, I tried it on PL and noticed it doesn't update, I tried this and it did



well anyway there's another problem
the angels just keep adding up, i make a full rotation it's 360, another rotation in the same direction makes it 720 :S

anyway to solve this?

TY
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 13:42 Edited at: 28th Dec 2008 13:46
solved used wrapvar=PlrAngel

but still can't put the script together, here's wut I got

Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 13:58
that's the best I could come up with, angels displayed correctly but huds don't show

Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 14:23 Edited at: 28th Dec 2008 14:44
FINALLY GOT IT TO WORK I JUST REMOVED VARLESS AND USED VARGREATER ONLY TY PLY

Here's the full code and soon I'll release the final version + compass hud
ofcourse change the hudx and y to whatever u want that was just a test

Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 14:45
btw will this large code affect how the game run?
TY
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Dec 2008 20:01
Nope, it won't effect very much at all.

BTW, in Ply's Mod, the new line cap is 300 lines of script. I've made a script that was super complex that used up all of these lines and the framerate was uneffected.


The one and only,



Click Me, Please!
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 28th Dec 2008 22:31
good to hear that TY
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 30th Dec 2008 11:10
well after trying it on a large level it lagged big time :S i guess it's becaue the ALWAYS line which writes the angel to the variable and directs to stat1
I tried to remove it and wrote it like that



but it didn't work :S any ideas why?
TY
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 30th Dec 2008 11:23
SOLVED Ty
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 30th Dec 2008 18:49 Edited at: 30th Dec 2008 18:51
I had thought about doing a compass with the stock engine, but scratched the idea thinking that the map wasn't big enough for one.

Has anyone tried making a compass script with the stock engine yet?

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Dec 2008 21:57
Quote: "large level"


That might be the source of your lag problem.

Writing to a variable isn't CPU intensive in the least, even done on every loop. I mean, if it was, there wouldn't be a game int he world that didn't lag.


The one and only,


Login to post a reply

Server time is: 2024-11-24 16:42:27
Your offset time is: 2024-11-24 16:42:27