A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Quick Scripting Question

Author Topic: Quick Scripting Question (24 messages, Page 1 of 1)
Moderators: Dennis

Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 16, 2015 06:17 PM    Msg. 1 of 24       
Hey all, been awhile. I'm glad to see that there's still so many people here and it's nice to see a lot of fresh faces as well. Anyways, I recently updated to v1.10 and Open Sauce 4.0 to try out TSC:E (which is great, I really enjoyed the map and appreciate the hard work that the team put into it). However, this broke one of the maps I started a couple years ago. Since I'm no longer active in this community, I thought I'd release what I had so far since I thought the idea was really cool and I've always wanted a full-fledged, modular RPG in Halo.

https://www.youtube.com/watch?v=bySvFp5jUEM

To accomplish this, I was using several persistent variables such as get_mouse_yaw_scale and things like that to store the weapons that the player had purchased between maps. Unfortunately, it doesn't seem to work the same way it used to in the past. For instance, I used to use get_mouse_yaw_scale to store all the weapons the player has purchased, and I'd use (> (get_mouse_yaw_scale 13) 0.5) to check if the player had purchased the sniper rifle (it's great to be back to LISP syntax, by the way..). While that worked in the past, it doesn't seem to now. Trying to set it using (set_mouse_yaw_scale 13 1) ingame don't seem to have any effects whatsoever. Does anyone know if the use of these variables patched? I want to fix this bug so I can release the map and the source so others can play around with the idea or finish the map.

Thank you all for your time, and it's great to see you guys again!


MEGA_VKNG
Joined: Dec 23, 2013


Posted: Mar 16, 2015 06:21 PM    Msg. 2 of 24       
So wait, you plan on releasing it? What about your badass tagset?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 16, 2015 06:29 PM    Msg. 3 of 24       
I've probably lost everything that isn't in this map. I started this map several years ago with a "clean" tagset, basically a fresh installation and UI elements that Jesse so graciously made for me and Halo 3 weapon bitmaps and models, which I then went to re-animate myself. I do plan on releasing all of the source for this map, I'll probably just upload the tags folder since I have no idea how extraction works with OS...

Also, since this is actually a collection of multiple maps, I used the shared maps feature in OS to create a shared bitmaps.map and things like that. Pretty neat and it cuts down on filesize, since each BSP and mini-mission gets its own map. I think I intended it to be completely modular, so I could release a base version with 3 training maps, and I could release DLC in the future without having everyone re-download every single map.


MEGA_VKNG
Joined: Dec 23, 2013


Posted: Mar 16, 2015 06:49 PM    Msg. 4 of 24       
Ah, I'm mostly interested in the scripts and animations. I needed something like this for a...*cough* now dead project.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 16, 2015 07:06 PM    Msg. 5 of 24       
Anything in particular?


il Duce Primo
Joined: Apr 22, 2007

CMT Team Leader


Posted: Mar 16, 2015 07:12 PM    Msg. 6 of 24       
You should also consider releasing your data folders. It's nice to see you here!


PRPatxi
Joined: Oct 30, 2010

Dennis, free me from this suffering


Posted: Mar 16, 2015 07:12 PM    Msg. 7 of 24       
One of my old friends returned T.T mytears of joy begging to flow.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 16, 2015 07:19 PM    Msg. 8 of 24       
Sure.

http://www.mediafire.com/download/dgxwts2xddxy6au/Hub+Scripts.7z

Here are the scripts for the project (neatly commented, I might add). I don't really have much left since my Hard Drive wipe all those years ago, but this is a start. I'll look through and see what I can find.


MEGA_VKNG
Joined: Dec 23, 2013


Posted: Mar 16, 2015 07:20 PM    Msg. 9 of 24       
Quote: --- Original message by: Gamma927
Anything in particular?


In terms of scripts, animations, or everything? I honestly love all your work, So it would be cool if you released the map and source files.

Edit: looks like scripts are released, Would love to see the anims released one day, I really like them alot.
Edited by MEGASEAN2812 on Mar 16, 2015 at 07:24 PM


PRPatxi
Joined: Oct 30, 2010

Dennis, free me from this suffering


Posted: Mar 16, 2015 07:26 PM    Msg. 10 of 24       
Quote: --- Original message by: MEGASEAN2812

Quote: --- Original message by: Gamma927
Anything in particular?


In terms of scripts, animations, or everything? I honestly love all your work, So it would be cool if you released the map and source files.

Edit: looks like scripts are released, Would love to see the anims released one day, I really like them alot.
Edited by MEGASEAN2812 on Mar 16, 2015 at 07:24 PM


I asked for those 2 years ago and his hd died.


MEGA_VKNG
Joined: Dec 23, 2013


Posted: Mar 16, 2015 07:28 PM    Msg. 11 of 24       
Couldn't he release the map and rip the tags?
Edited by MEGASEAN2812 on Mar 16, 2015 at 07:28 PM


PRPatxi
Joined: Oct 30, 2010

Dennis, free me from this suffering


Posted: Mar 16, 2015 07:30 PM    Msg. 12 of 24       
Quote: --- Original message by: MEGASEAN2812

Couldn't he release the map and rip the tags?
Edited by MEGASEAN2812 on Mar 16, 2015 at 07:28 PM


Dunno I haven't seen Gamma since 2013 X-mass when I asked for some tutorials(more like posts) he made on scripting so I could translate them.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 16, 2015 07:47 PM    Msg. 13 of 24       
Yeeeeaahh, that's about the last time I actually did anything.

Unfortunately, I can't rip the maps, since I compiled them with the OS feature that creates a project and compiles a bunch of shared maps, which messes with the ripping thing.

Fortunately, I do have the source files for the stuff in the video after I painstakingly recreated everything. I will release everything, but I'd like to fix this bug before I do, so the map is at least more playable :P If anyone can help me out with the problem outlined in the OP, that would go a long way towards getting that release out :P

In the meantime, of course, if there's any tags that you guys really really want, I can make some exceptions and upload those individually. I am procrastinating on studying for a final tomorrow, so I may not reply as quickly as you'd want, but I'll pop back in here from time to time. If any one wants to just chat for old times' sake, I am online on Steam for the first time in forever (Steam ID: gamma927).


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Mar 18, 2015 03:34 PM    Msg. 14 of 24       
Quote: --- Original message by: Gamma927
I'd use (> (get_mouse_yaw_scale 13) 0.5)


It was patched in 1.0.10, because its an array overflow (Moment kornman saw that I was overflowing arrays to write my own data, he immediately talked to bungie, and had it added to the patch list). Anyways, the array has a length of 4, so you can still use 0,1,2,3 but not values like 13, which is what you are using right now. (I had so much fun purposely overflowing arrays writing random values... you could actually change the order the game rendered items, and overwrite fonts, it was the best. You could totally setup a dynamically changing server that would eventually crash lol)


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 18, 2015 03:54 PM    Msg. 15 of 24       
As a Javascript programmer used to breaking array sizes all the time, this irks me :(

I guess I'll store weapon values in a binary array and use the decimal representation for the variable instead? You wouldn't happen to have a script to convert a decimal to binary and vice versa, would you :P


PRPatxi
Joined: Oct 30, 2010

Dennis, free me from this suffering


Posted: Mar 18, 2015 04:14 PM    Msg. 16 of 24       
Quote: --- Original message by: Gamma927
As a Javascript programmer used to breaking array sizes all the time, this irks me :(

I guess I'll store weapon values in a binary array and use the decimal representation for the variable instead? You wouldn't happen to have a script to convert a decimal to binary and vice versa, would you :P


xD I remembered that old Java tutorial with 'Bucky'(NewBoston)


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Mar 18, 2015 04:20 PM    Msg. 17 of 24       


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 18, 2015 08:53 PM    Msg. 18 of 24       
...you just have everything, don't you :P

Just curious, how difficult is it to create new script functions using Open Sauce? I'd love to create simple helper functions such as something for binary conversion or modulus because I really did not miss LISP syntax that much :|


Ubermaniac
Joined: Dec 22, 2014

Bleach. Y'know what I mean?


Posted: Mar 18, 2015 08:56 PM    Msg. 19 of 24       
oh great kirby senpai plz notice me


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Mar 18, 2015 11:16 PM    Msg. 20 of 24       
Quote: --- Original message by: Ubermaniac
oh great kirby senpai plz notice me

>senpai noticing you.




Quote: --- Original message by: Gamma927
...you just have everything, don't you :P

Just curious, how difficult is it to create new script functions using Open Sauce? I'd love to create simple helper functions such as something for binary conversion or modulus because I really did not miss LISP syntax that much :|


I actually covered modulus in two ways, in one of my old scripting tutorials.

Lazy way
(global short var1 0) ;;Global Variable ;;Input 1
(global short var2 0) ;;Global Variable ;;Input 2
(global real result1 0) ;;Global Variable ;;Result as a decimal number
(global short result2 0) ;;Global Variable ;;Correct result.
(script static short modulus ;;Returns a 'Short' (Non-decimal number, within 2^16)
(set result1 (/ var1 var2)) ;;Get decimal of input1 / input2
(set result2 (/ var1 var2)) ;;Get non-decimal copy of input1 / input2
(set result1 (- result1 result2)) ;;Difference between decimal and non-decimal (less than 1)
(set result2 (* result1 var2)) ;;Difference * input 2, without decimals
(set result1 (* result1 var2)) ;;Difference * input 2, with decimals
(if (!= result1 result2) (set result2 (+ result2 1))) ;;If data was lost in decimals, restore rounding.
(+ result2 0) ;;Return result2 variable.
)


Proper recursive way.
(global short in0 0)
(global short in1 0)
(script stub short modulus
;;This here is garbage, it's just to let sapien know
;;that a script called modulus that returns a short, exists.
;;Without this, the static script would have an error that 'modulus' is undefined.
(+ 0 0) ;;Returns a number. This'll always return 0.
)
(script static short modulus
(if (< in0 in1)
(+ 0 in0) ;;If in0 is smaller than in1, return in0.
(begin
(set in0 (- in0 in1)) ;;Otherwise, reduce in0 by in1.
(modulus) ;;Then repeat this.
)
)
)


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: May 8, 2016 04:20 PM    Msg. 21 of 24       
Eyyy, one year bump. I'm kinda bored right now and looking to finally finish this. Not really sure who's still doing Halo stuff, but if anyone's free, hit me up on Steam cause I need a couple beta testers.

Also, getting the following error message when trying to open OS_Sapien to compile the script:


Sun May 08 14:15:20 2016

14:15:20 CheApe: Couldn't allocate the memory map! (1E7) UNKNOWN MAPPING PROCESS
Try restarting your computer if this problem persists.
14:15:20 CheApe: Yelo initialization failed!

Edited by Gamma927 on May 8, 2016 at 05:13 PM


Pepzee
Joined: Sep 9, 2010


Posted: May 8, 2016 07:53 PM    Msg. 22 of 24       
Who doesn't like beta testing!?

Is this the variables across multiple levels project? If you want assistance let me know, I'd love to get involved.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: May 8, 2016 08:13 PM    Msg. 23 of 24       
Yeh, hit me up on steam. I fixed the weapons script. If anyone's curious how I did it (not the best way cause I clearly don't remember how to script anymore >>), pseudocode was:

Store value as binary array decimal: 0.01011 for false, true, false, true, true.
Multiply by 10 and check if >= 1
If so, set local variable as true and subtract 1
If not, set local variable to false
Then multiply by 10 and repeat again

Since there are no loops or helper functions, I just c/ped that logic 17 times so the script is pretty ugly, but it works!

Also the map itself is pretty unbalanced but I just want to see if it works.


ziko
Joined: Feb 26, 2011

Raw!


Posted: May 10, 2016 06:02 AM    Msg. 24 of 24       
Great to hear that your back! I've been looking forward to playing this since your last post (last year), This map is defiantly fresh and unique, with innovative RPG elements that make the map feel alive, such as having the pillar of autumn map as the HUB to launch into your next mission, marines walking around and talking and also the addition of loading up maps within maps!

This map has a lot of potential and hopefully be implemented into other maps and built upon in the future!

I'm defiantly up for beta testing, I added you on steam.

 

 
Previous Older Thread    Next newer Thread







Time: Sun December 8, 2019 5:01 PM 343 ms.
A Halo Maps Website