All times are UTC





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Random script coding that work (somewhat)
PostPosted: May 28th, 2015, 3:03 am 
Offline
Veteran Member
User avatar

Joined: April 2nd, 2015, 2:59 pm
Posts: 152
Has thanked: 15 times
Been thanked: 16 times
Decided to make this under the tutorial section since while it's not a tutorial per say, you can learn what and how it works, thus teaching you and being somewhat helpful.

If you have working code, please share them in a reply so we all can start to understand this glitchy code somewhat.

Pastebin version of the trigger pdf:
Spoiler:
http://pastebin.com/ab81qJjH

Random endless titan spawner (goes past 50 cap for some reason ATM):
Spoiler:
OnUpdate()
{

VariableInt.Set("myType",VariableTitan("myTitan").GetType());

VariableInt.Set("myHealth",VariableTitan("myTitan").GetHealth());

VariableFloat.Set("mySize",VariableTitan("myTitan").GetSize());

VariableFloat.Set("posX",VariableTitan("myTitan").GetPositionX());

VariableFloat.Set("posY",VariableTitan("myTitan").GetPositionY());

VariableFloat.Set("posZ",VariableTitan("myTitan").GetPositionZ());

VariableFloat.Add("mySize",0.5);


Titan.SpawnTitanAt(VariableInt("myType"), VariableFloat("mySize"), VariableInt("myHealth"), 1, VariableFloat("posX"), VariableFloat("posY"), VariableFloat("posZ"));


}

I came across this on accident due to experimenting around with my failed attempt to create a growing titan everytime someone is eaten.


Round start message (doesn't have spaces)
Spoiler:
OnRoundStart()
{
Game.PrintMessage("Welcome dirtbags!")
}

Simple, and seems to be one of the few commands that are actually working somewhat ATM. However, for some reason no matter what you type in, it always takes out the spaces, and leaves you with the words themselves, so the above code will have an output of white text in the chat that says "welcomedirtbags!"


Two random code bits that are the result of 4 hours of trial and error *strangles someone*:
Spoiler:
http://pastebin.com/LcQqqNbR
The first code was supposed to be part of a long complicated way to make bigger titans spawn after someone was eaten, but didnt work out.
The second one was created due to the desparate feeling you get when 4 hours of testing various codes hadn't brought anything good of worth.


My Ykwii map script:
Spoiler:
http://pastebin.com/xUvp4PLC
This one uses OnPlayerEnterRegions and the message command. Note, the message command broadcasts to the WHOLE server, or at least the MC sees every time someone did it. Another note, you CANT have endless mode on when entering this code otherwise you dont spawn in. One final note, the message CAN ONLY be long enough to fit on the first line, otherwise it doesnt work. Thats why I have 5 different message statements for 1-2 sentences.

_________________
Spoiler:
Image

Spoiler:


Last edited by xXSB101Xx on May 29th, 2015, 10:35 pm, edited 2 times in total.

Top
 Profile  
 


 Post subject: Re: Random script coding that work (somewhat)
PostPosted: May 28th, 2015, 2:45 pm 
Offline
Newbie Artist
User avatar

Joined: September 14th, 2014, 2:11 am
Posts: 46
Has thanked: 14 times
Been thanked: 43 times
I made a cage match map and script to go with it but after testing and discussion with Rice, random sizes are impossible (from the hours I tried). It always selects the lowest size. Instead they are all 10m. If you want to make your own map, just make 4 regions, named the same as in the script, or change the script.
To play just go on team mode and start killing. Sometimes the randomly spawning titan will spawn in one of the regions. Nothing I can do about that I think.

Game script
Spoiler:
OnPlayerEnterRegion["megenta_player"]("myPlayer")
{
Titan.SpawnTitanAt(0, 2.0, 100, 1, RegionRandomX("megenta_area"), 3.0,RegionRandomZ("megenta_area"));
}
OnPlayerEnterRegion["cyan_player"]("myPlayer")
{
Titan.SpawnTitanAt(0, 2.0, 100, 1, RegionRandomX("cyan_area"), 3.0,RegionRandomZ("cyan_area"));
}
OnTitanDie("myTitan", "myPlayer")
{
Titan.SpawnTitanAt(0, 2.0, 100, 1, RegionRandomX("megenta_area"), 3.0,RegionRandomZ("megenta_area"));
Titan.SpawnTitanAt(0, 2.0, 100, 1, RegionRandomX("cyan_area"), 3.0,RegionRandomZ("cyan_area"));
}


Map:
Spoiler:
spawnpoint,playerC,-189.7014,0.4253061,-64.31046,0,0.9999796,0,0.006383583;
customb,house1,default,1,1,1,0,1,0.3181819,1,2,2,70.43773,16.33562,-83.79403,0,0.9999993,0,-0.001174471;
customb,house1,default,1,1,1,0,1,0.3181819,1,2,2,-40.27477,16.41535,-83.80655,0,0.9999987,0,-0.001625139;
custom,tower4,default,1,1,1,0,1,0.3181819,1,2,2,18.27468,52.20946,-178.2258,0,0.0005081258,0,-0.9999999;
custom,house2,default,1,1,1,0,1,0.3181819,1,2,2,18.78477,-1.428877,-26.47618,0,-0.99999,0,0.004465858;
spawnpoint,playerM,19.08409,0.9063261,-64.35792,0,-0.0003148508,0,-0.9999999;
misc,region,megenta_area,180,250,180,16.16312,118.5803,-112.0168,0,0,0,1;
base,aot_supply,2.954276,0.512391,-20.74901,0,0.0002629433,0,-1;
misc,region,cyan_player,200,250,200,-189.0779,86.66095,-112.0827,0,0,0,1;
custom,house2,default,1,1,1,0,0.375,1,1,1,1,-188.4605,-1.722361,-25.53718,0,0.9999993,0,-0.001225688;
custom,tower4,default,1,1,1,0,0.375,1,1,2,2,-187.6337,51.98315,-178.0087,0,0.001979679,0,-0.999998;
customb,house1,default,1,1,1,0,0.375,1,1,2,2,-137.258,15.85296,-84.01797,0,0.9999998,0,0.0006861256;
customb,house1,default,1,1,1,0,0.375,1,1,2,2,-247.9344,15.81958,-84.62609,0,0.9999999,0,-0.0005021101;
base,aot_supply,-202.5629,0.2391167,-20.19679,0,0.004929592,0,-0.9999878;
misc,barrier,20,25,1,121.6129,103.7368,-113.8861,0,0.707107,0,0.7071066;
misc,barrier,20,25,1,18.24206,110.9636,-8.639355,0,0,0,1;
misc,barrier,20,25,1,17.56327,108.2312,-215.7944,0,0.0003490659,0,0.9999999;
misc,barrier,20,25,1,-189.5363,105.8903,-216.7186,0,-0.001047197,0,0.9999995;
misc,barrier,20,25,1,-293.636,108.772,-113.9884,0,0.7066131,0,0.7076002;
misc,barrier,20,25,1,-190.0826,109.7858,-9.380775,0,0.001396263,0,0.999999;
misc,barrier,20,25,1,-86.11042,108.2405,-112.5408,0,0.7068602,0,0.7073534;
misc,region,megenta_player,200,250,200,17.05974,91.22514,-113.0528,0,0,0,1;
misc,region,cyan_area,180,250,180,-188.939,117.4843,-112.8703,0,0,0,1;
custom,cuboid,earth1,20,2,20,0,1,1,1,2,2,18.07632,-9.863219,-112.9792,0,-0.001032465,0,0.9999995;
custom,cuboid,earth1,20,2,20,0,1,1,1,2,2,-189.5749,-9.931935,-112.9288,0,1,0,0.0002717535;

_________________
Image


Top
 Profile  
 
 Post subject: Re: Random script coding that work (somewhat)
PostPosted: May 29th, 2015, 10:46 pm 
Offline
Veteran Member
User avatar

Joined: April 2nd, 2015, 2:59 pm
Posts: 152
Has thanked: 15 times
Been thanked: 16 times
Updated with my Ykwii map code that uses onplayerenterregion and game.printmessage

_________________
Spoiler:
Image

Spoiler:


Top
 Profile  
 


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Style created by © Matti, gry komputerowe, alveo witaminy zdrowie witaminy

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group