StringContains Function

Post » Tue Jun 19, 2012 11:49 pm

Is there a function to verify if a string is conteined in another string? If not I can program it, but.. how to see a single character of the string? For example:
string arr="jesus"
arr[0]="a" //error
User avatar
Ricky Rayner
 
Posts: 3339
Joined: Fri Jul 13, 2007 2:13 am

Post » Tue Jun 19, 2012 2:57 pm

As far as I know, the only things you can do with strings is cast them to other types and concatenate them. They're rarely the slightest bit useful in Papyrus at the moment, although hopefully SKSE will be able to improve the situation eventually.

Cipscis
User avatar
Melanie
 
Posts: 3448
Joined: Tue Dec 26, 2006 4:54 pm

Post » Tue Jun 19, 2012 10:01 pm

As far as I know, the only things you can do with strings is cast them to other types and concatenate them. They're rarely the slightest bit useful in Papyrus at the moment, although hopefully SKSE will be able to improve the situation eventually. Cipscis

I wouldn't call them useless -> The functions that take Strings as input are very useful -> MoveToNode, SplineTranslateToRefNode, AddHavokBallAndSocketConstraint are exceedingly useful for quite a few dynamic effects -> Being able to target Nodes (By name) within .nifs is something that used to take all kinds of work arounds...

Just to give a few examples.

I use MoveToNode for my Organizers -> basically they replace the convoluted bookshelves and weapon stands and by targeting Nodes I can animate their positions for in game options.

I use SplineTranslateToRefNode in several of my custom spells to have the projectiles attack certain parts of the body with different effects.

I use AddHavokBallAndSocketConstraint to dynamically attach Sea Lampreys' (Custom Creature) to the player if they go into a few certain watery areas and the effect is they animate kinda like a leech svcking your health out and the more you have attached the quicker you die.
I also use this in some of my Quest Scene's for Specific actors so they can move objects in the world around without having to create dummy objects -> only have 3 scene's using it ATM but I think that number will explode over time and mod maturity.
User avatar
flora
 
Posts: 3479
Joined: Fri Jun 23, 2006 1:48 am

Post » Tue Jun 19, 2012 1:51 pm

Those are pretty much the rare instances I meant, yeah, although they're certainly much more in your domain than mine. I just think it's just a shame that some of the more obvious string functions you might expect to see, like this one or functions to get/set the names of references, weren't implemented.

That stuff you have going on sounds pretty damn cool, I have to say. The lampreys in particular I like the sound of.

Cipscis
User avatar
Reven Lord
 
Posts: 3452
Joined: Mon May 21, 2007 9:56 pm

Post » Tue Jun 19, 2012 9:01 pm

Mmm I solved creating an array of races.
User avatar
Siobhan Wallis-McRobert
 
Posts: 3449
Joined: Fri Dec 08, 2006 4:09 pm


Return to V - Skyrim