scripting: Explain what these are?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

scripting: Explain what these are?

Post by Elgan »

a couple of things i have no clue to what they do. what are they:S



openportal

Open the area portal enclosed in this object

closeportal

Close the area portal enclosed in this object

so portal?

skyportal ( Boolean newSkyPortalState )

Whether or not to use the sky portal at all

lavacolor ( Vector lavaColor )

Set the color of lava screen blend

what lava:S

how to use?
CreateListener

delaythrow ( String label )

Internal usage.


error ( String message, Integer level )

Generate a script error with specified message and stack level

:S

throw ( String label )

Throws to the specified label.

timeout ( Float time )

specifies script timeout time


assert ( Float value )

Assert if value is 0.


bool ( Integer value )

Casts value to a bool.

testthread ( String scriptfile, [String label] )

Starts the named thread at label if provided.

centroid

entity's centroid

motionfail

motionfail
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Re: scripting: Explain what these are?

Post by jv_map »

:shock: Wow that's a load of q's but I'll share what I know :)

openportal and closeportal are self-explanatory, just read a tut on areaportals ;)

skyportal as far as I know isn't working correctly.

lavacolor : no clue probably not used at all.

CreateListener

Sometimes used as 'local.someobject = local CreateListener' , same as 'local.someobject = spawn listener'.

delaythrow : don't know :?

error : worst command ever, (never use!) it breaks the entire mohaa script system :shock:

throw : don't know :? maybe should be used in conjunction with try and cache? :?

timeout : I think this defines the script execution time which makes the map crash with an infinite loop error. Set level.loop_protection = 0 to disable infinite loop errors completely (use at own risk ;)).

assert : In FAKK2 this is used to break into the debugger from script, so probably it only works with the debug build of mohaa not with the release version we all have (doesn't seem to do a thing atm).

bool : turns integer into boolean (1 or 0) :) bool 5 would return 1, bool 0 would return 0.

testthread : this just starts a thread, can also be called from console I think.

centroid : not sure but I think this returns the centroid of the bounding box of an entity.

parm.motionfail I think would have to do with the setmotionanim command for AI, don't think it's very useful.
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

cool ty

portals-ohh:D. didnt link portal with area portal:S
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

error : worst command ever, (never use!) it breaks the entire mohaa script system

throw : don't know maybe should be used in conjunction with try and cache?
these are C/C++ commands, i think waittill works with error, and is useful for devving... and throw is used for functions and class changes. and keyboard input, it's all handled...
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

could u give us an example fo throw?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

they wont work in scripting..

i use it in Java but it's based on C++ (almost exactly) so it's definitely C++, you use to to throw, and catch exception, error, uhm, i dont have my compiler with me or i'd list the whole lot.

Code: Select all

public static void myMethod()throws Exception
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply