Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 13/11/07 3:01

ItemfinderDeluxe
Member
From: Canberra, Australia
Registered: 12/11/07

First script, need some pointers

I'm currently working on a 'small' script that allows the player to control Barabas in the TCTF HQ when he's grabbing Shinatama.  It's only in its early stages, and since I'm only somewhat new to coding Oni Script, I'd like to ask for some advice from those who have done this before.

I've set up Shinatama in the same fashion as she's set up for the 'Kidnap' cutscene, with a few extra lines of code to try and adapt her for the combat scenario. It seems to work fine, until I have Barabas start spamming his Earthquake special, thus shifting Shinatama out of position and into a combat stance (which I don't think is appropriate, given the circumstances).  I currently have:

chr_create 1101 start
chr_envanim 1101 KidnapShinBox02
chr_animate 1101 SHINATsit_idle 3000
chr_invincible 1101 1
chr_unstoppable 1101 1
chr_lock_active 1101

My questions are:

1. What else can I go to correct the movement caused by Earthquake spam? This is mainly because I don't know how many people would start abusing Earthquake when fighting in the narrow pathways.

2. Is there some way to put all of the set-up code into one function? Geyser's neuro-suprise script uses custom functions, but I'm not too sure on how to write one with booleans and animation commands.


TCTF SWAT: Striker, you're under arrest.
Striker: H4h, y0u c4n'7 570p m3!!!
TCTF SWAT: Damn it, learn to spell!!!
CURRENT PROJECT - 'Nemesis' V1.0 Released

Offline

#2 13/11/07 5:53

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: First script, need some pointers

The context of your script is not clear. Do you mean Shinatama is sitting in her Damocles chair while the player fights the TCTF troops that defend her?
1. I can't test anything right now, but if chr_unstoppable is not enough, try chr_nocollision. You should also make sure to keep Shinatama's facing fixed.
2. Not sure what you mean, but you can single out any amount of code as a separate function. It's really not harder than anything you've done so far.

func Setup {
chr_create 1101 start
chr_envanim 1101 KidnapShinBox02
chr_animate 1101 SHINATsit_idle 3000
chr_invincible 1101 1
chr_unstoppable 1101 1
chr_lock_active 1101
}

or, if you want to get used to the strong syntax:

func void Setup(void) {
chr_create(1101, start)
chr_envanim(1101, KidnapShinBox02)
chr_animate(1101, SHINATsit_idle, 3000)
chr_invincible(1101, 1)
chr_unstoppable(1101, 1)
chr_lock_active(1101)
}

although it's absolutely not necessary here.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#3 14/11/07 4:43

ItemfinderDeluxe
Member
From: Canberra, Australia
Registered: 12/11/07

Re: First script, need some pointers

Thanks for the reply, Geyser.

Yes, it is a script where you play as Barabas and smash your way through hordes of TCTF troops to grab Shinatama.  Theoretically, it takes place after the cutscene where they disable the power sub-stations, but before they jam the pathway between the atrium and the 'gangway' as I call it.

Anyway, I tried out the no_collision line, and Shinatama seems to be a little better then before. I'm still hoping people don't have to resort to Earthquake spam when on the level though.  I also tried to incorporate the set-up of Shinatama into a function, but whenever I loaded the level from Save point 4 (where I'm basing the initial code from), it would play the opening movie, and then spawn everyone from Save point 4 (in other words, nobody).  In the end, I left it out.

I also need to ask, how can I set up the script to recognise commands from another custom-made script in the file? As an example, the OTA scripts are all called arena_(something).  How does the OTA script link the various files together to run, and how can I do so.  The reason I'm asking is because I want to add a custom script to handle the spwaning of TCTF and Syndicate characters when Save point 4 is loaded, as to not overburden the main script.


TCTF SWAT: Striker, you're under arrest.
Striker: H4h, y0u c4n'7 570p m3!!!
TCTF SWAT: Damn it, learn to spell!!!
CURRENT PROJECT - 'Nemesis' V1.0 Released

Offline

#4 14/11/07 22:01

Your_Mom
Member
From: Canada
Registered: 31/1/07
Website

Re: First script, need some pointers

Nice thing is, script names don't matter - you can name em whatever tongue


droid803sig.jpg

Offline

Board footer

Powered by FluxBB