Lot of questions about modding

Discussion about Shadowgrounds and Shadowgrounds Survivor Mods and the Level Editor.
User avatar
MoRt
Posts: 9
Joined: Fri Apr 20, 2007 11:47 pm

Lot of questions about modding

Postby MoRt » Sat Apr 21, 2007 12:04 am

Hello,

I saw that Joel answers a lot of questions, so i give a try.

First forgive my english, but I do my best...

So here the questions:
- First, I try to do a PDA. It works perfectly as it is in the tutorial. But, I added a custom item script, on the PDA, like "open_remote_1". Then the PDA was able to open the door, but unreadable, and didn't dissapear from the ground. If I delete the custom item script, then the pda is readable, but I can't open my door. The question is: Is there only one and only one script that can be apply to an item ?

- Second, I open then my door, with a terminal. But I wanted that this door, later close by itself. So I tried with a "common, trigger, general" zone, but it didn't work at all. I used "custom main script" with the command "close_remote_1:main", or "custom execute script" with the command "close_remote_1", and even to create my own script : "custom main script" with the command "testmission:main", with the following code:

Code: Select all

script testmission
sub pickup
  // nop
endSub
sub execute
  set_var(opened_remote_1, 0)
endSub
endScript

But still it didn't work... So can i get some help, to close a door, with a trigger zone.

- Third. Yeah I know lot of questions... But you can request some holiday after this... ;) I tried to trigger the boss of the mission10. The BIG wrencher, with four arms (to eat faster). But I couldn't make it appear. I didn't find any trigger command to make him appear. How can I deal to spawn other creature than the basic one? Because there are no commands to spawn the mission10 boss. And what the use of the "C, Alien, replace, triggered", towards "C, triggerpoint, alien spawn replace"? What are the differences, or the uses?

- Last. (Pfff) What is the use of "condition variable" for item, like weapon or munition?

Thank you, for your attention, and answers ^^

User avatar
fb_joel
Site Admin
Posts: 2482
Joined: Fri Feb 18, 2005 2:14 pm
Location: Finland

Postby fb_joel » Mon Apr 23, 2007 2:46 pm

Sorry for the little delay.

How did you add the "open_remote_1" command? I don't have time to test this unfortunately... You would probably be better off by simply creating a custom trigger near the PDA that does the same, unless it's really important to only have the door open if the player has read the PDA.

I created three new sample scripts:

link 1
link 2
link 3

These will most likely help you.

Regarding the big wrencher, I must say I don't know how to get that into the game. Did you try "Mission 10, Alien, M10Boss" at the end of the script list? I guess that should work.

Triggered aliens are used if you want an alien that is activated by a script later in the mission. Non-triggered alien have AI activated at the beginning. Sometimes you want aliens to get activated at certain point, so you can get a good patrol route going for example... If you want to use aliens in the scripts, you must give each alien an ID number and then use setUnitByIdString "alien1" etc to be able to use them.

The triggerpoints work together with Trigger, Alien spawn x5, etc. It just allows you to choose which kind of aliens to spawn. It's been a while since I've last used this feature though, but theoretically it should allow easy spawning of monsters (no scripting).

Condition variable means this: if you set a variable there, the game will wait until that variable is set to ON (1), and only then will the item appear. (I think - haven't tested, but this is how it works with other scripts etc).

I guess that was all. Let me know if you have any problems. :)
// Joel, Frozenbyte team

User avatar
MoRt
Posts: 9
Joined: Fri Apr 20, 2007 11:47 pm

Postby MoRt » Mon Apr 23, 2007 4:20 pm

Thank you, for your answer. I will try the three example script, you gave me.

For the PDA, which opens the door, it was in the case when the player through the pda/computer screen speaks to someone else, who will open the door remotely.

I will try again for the Mission10 Boss, and now I get the point with the different trigger. I will try to make a guard path, to test these triggers.

For the "condition variable": How can I put a value to a variable? With the "trigger, set variable"? Or do I have to use script for this?

Anyway, I will try this. Thank you for your answer...

EDIT : Ok, I look the script. They will really helpful. Thank you...

But further questions come, while reading them...

During the first mission of SG. After fixing the electric boxes, the boxes turns from red to green. How do you insert the new object? You just add both of them, with the editor, and make sure only the red boxes is visible, and later you delete the upper box, so the green box appears? Or is there any other ways ?

How can I make a scavenger comes out from a ventilator, like in the second mission... The grating falls down and scavengers come out, or later, a floor grating is moved, and wrenchers come from the floor.

I have many things left to learn, so don't bother to answer too fast...

Thank you ^^
Last edited by MoRt on Thu Apr 26, 2007 4:31 pm, edited 2 times in total.

User avatar
fb_joel
Site Admin
Posts: 2482
Joined: Fri Feb 18, 2005 2:14 pm
Location: Finland

Postby fb_joel » Tue Apr 24, 2007 2:12 pm

There's two ways you can give a value to a variable. The first one is in the Editor, by using a "C, Trigger, General..." and using a Triggered script process in the Main box. I wouldn't personally use this because it makes it harder to remember when editing the scripts. I would use the scripts, and either make a separate script or just put it as part of an existing script.

To set the value, simply write "setValue 1; setVariable myvariable" and that's it. You can also use the "set_var(myvariable,1)" macro command (at least in the scripts, not sure about in the Triggered script process).

Of course you have to have the variable created first. You can just use "global int, myvariable" somewhere in the beginning of the scripts, before the subs.

The electric boxes, heh. I was <----> this close to including them in the sample scripts. So basically in sub progress_done just after disableItem 0, just insert:

changeItemModel Data/Models/Terrain_objects/Terrain_misc/PowerPlant/Fixable_terminal_02_activated.s3d

I'm not sure if this works for all items or just some specific ones.

The scavengers coming from the ventilators should work like this:

- In the Editor / Scripts, choose "C, Ventilator small 1" and place it somewhere
- Then choose "C, Alien, Scavenger" near the top of the list
- Place the Scavenger near the Ventilator, then choose "Alien, Scavenger" in the Scripts/Spec box
- Then "Common, Scavenger ventilator" in Scripts/Main
- And then fill the rest with "Common, Scavenger conditional", except for Execute which can be (empty).

That should be it...
// Joel, Frozenbyte team

User avatar
MoRt
Posts: 9
Joined: Fri Apr 20, 2007 11:47 pm

Postby MoRt » Tue Apr 24, 2007 9:23 pm

Oohh, really great...

I may be the only one dumb scripter, which doesn't get a part of the editor, because I'm the only one, who asks questions...

Anyway, thank for the answer. That helps a lot. For the moment, I pass a lot of time for the "lady part" of the job: interior decoration... Really difficult to get a good looking for each rooms of my buildings, and even for the buildings themself...

I will try this, and here are the next questions ^^

- I use "shadow casters"-like lights for interior light of my buildings' rooms. But some of the lights light up parts of the floor behind a wall... For some place, walls block the light, but for some others light go accross the wall, and lights up the floor, where I first want darkness ^^

- I didn't get the point, how you created a guard path for the lazy wrencher (You know the ones near the barrels in fire. Teachers always said that people near warmers are lazy), in the sample mod.

- Sometimes when I open a map with the editor, with the tabs "LIGHT" activated, then when the map appears, there is an additional light, "Lightning" or "shadow caster", added on the map, that I can't delete or even select...

Thank you. I do my best to show you the mod, as soon as possible... Or a least the first mission ^^

User avatar
Blitzkrieg
Posts: 27
Joined: Tue Dec 12, 2006 5:11 am

Postby Blitzkrieg » Wed Apr 25, 2007 5:57 am

I really want to test out your mod... And if you're asking that much question that's probably because only a few people tried to make a mod.

Good Luck.
Image

User avatar
MoRt
Posts: 9
Joined: Fri Apr 20, 2007 11:47 pm

Postby MoRt » Wed Apr 25, 2007 1:43 pm

In the same time, I m kind of maniac... I try to make everything perfect. But some times, it's hard to understand how works the editor...

If there was a manual which explain the reason of each think in the editor, one by one, maybe I wouldn't ask, but I don't think many people may read it. The message board was the best choice...

And by the way, I begin to like bothering our moderator Joel... One time I will find the question, he couldn't answer... ^^

EDIT : I try the "ventilator spawn" scavenger, and it worked quite good, but the scavenger goes through the grating to appear, it doesn't make it fall down or break it... I try other variables...

EDIT 2 : Ok I found. You give an id to the ventilo, like "ventilo1", and then in the properties "ventilator" of the scavenger, you set "ventilo1"... I added another scavenger, without "ventilo" varaibles, but with "2" in the "attack_delay" variables... I then got a scavenger opening the ventilator and going outside, and 2 sec later, another one is following... I tried with hatch on the ground, anyway but it still doesn t work... What the "moves" for scavenger, for coming from the ground ?

Furthermore, I tried to make a guard path or an attack to a wrencher, but I failed. ^^ How to set up a guard path with the editor, like in the sample mission ? And how to use "C, Alien, Wrencher, Triggered" to attack at a certain moment: i.e. when the player use a compter screen...

EDIT 3 : Lots of try, today. I couldn't make a brute mauler break a door. I used the same path.
- In the Editor / Scripts, I choose "C, door breakable" and I placed it somewhere
- Then I choose "C, Alien, Brute mauler"
- I Placed the Brute mauler near the door, then I choose "Alien, Brute mauler" in the Scripts/Spec box
- Then "Common, Brute Mauler break door" in Scripts/Main
- And then fill the rest with "Common, Brute mauler conditional", except for Execute which can be (empty).

But the mauler didn't break the door, when I came next to him. I used a "waiting" mauler, and even a triggered one, with the following script:

Code: Select all

script test

global int, brute_break_door01

sub main
// let's wait until player gets to the trigger area
wait_until_player_closer_than_scriptrange()
// let's output a message just to make sure the script is running
hintMessage "Script is running ok"

// let's wait 2 seconds
waitAccurate 2000
// Let's activate the brutus
set_var(brute_break_door01, 1)

endSub

endScript

I used the script with a "C, Trigger, General", and "test:main" as a "custom_main_script", and set "brute_break_door01" the trigger_variable of the brute mauler.

I don't know where I'm wrong, or if the way to break doors is different than making scavenger jumping from ventilator. ^^

Oh, looks like a big post... Sorry -.-''

User avatar
fb_joel
Site Admin
Posts: 2482
Joined: Fri Feb 18, 2005 2:14 pm
Location: Finland

Postby fb_joel » Thu Apr 26, 2007 10:35 am

You found the question; I don't know why the lights bleed to areas they aren't supposed to go. You can try to minimize this by selecting an object and then using the Page Up and Page Down buttons to make the objects more or less subject to light...

One thing with lights is that you can only have 2 lights that affect any given object (or maybe three, I'm not sure). Try removing one or two lights and see what happens.

Regarding the extra light that can't be deleted - that sounds really weird! I'll look into this but in the meantime you should not open maps with the Lights tab activated. :)

Glad to hear you got the ventilator Scavengers working. It seems I forgot the id part, sorry!

Scavengers coming from the ground... I may be wrong on this, but I think it was only used in Mission 1, and in that one it seems it was done by animation + warpToPosition. That's why you can see the shadows of the Scavengers before they come up... So it's probably not possible to make Scavengers come from the ground. I also checked how it was done with Wrenchers in Mission 2, and well... awful lot of scripting! (it's \Data\Missions\Mission2WTF\sp\giveaccess2.dhs ).

Wrencher path and Brute in the next post...
// Joel, Frozenbyte team

User avatar
MoRt
Posts: 9
Joined: Fri Apr 20, 2007 11:47 pm

Postby MoRt » Thu Apr 26, 2007 2:55 pm

Well for the wrencher from the ground, I will check, but looks hard... Let's try.

I got my answers too for the light:

Example picture

- I used the "floor 2.5m" object, for the ground of my building, and added some wall to make the 2 rooms. The point is that some "pieces" of the floor are on both sides of the wall, so they are lighted up by the 2 lights. For this reason, the light go accross the wall. Because when one object is lighted up, then the whole object is lighted up, and not only a part... Same problem the transversal wall: the piece of wall is cut by the other wall, and then are lighted by the lights from both sides of the wall...
I need to cut these objects, and make them stop before the other room.

- For the additional and removable light, I think its just a bug from my PC, which may be to hot, because when I booted my pc, they disappeared. So this is not a problem anymore. ^^

Ok, that's all. I got check the scripts of the mission2's wrenchers...

EDIT : Ok, I made wrenchers come from the ground. I used the same script as in the mission2wtf...

For those who are interested:
- In the Units/Scripts list, choose "C, Ventilator big hatch". Then click properties, and write "floor_hatch" in the ID field.
- In the Units/Scripts list, choose C, Triggerpoint, Alien spawn Wrencher. Create the spawn trigger just above the "big hatch", then choose pre-made settings for Spawnpoint, Alien, Wrencher. Then click properties, and write "floor_wrencher_target" in the ID field. Just ignore "trigger_variable"
- In the Units/Scripts list, choose "C, Trigger, General, x1 , 0250cm , Circle Full , 0", and place it somewhere on the map, and select Custom main script from the Main scripts drop-down box. Then write "wrencher_floor_attack01:main" to the custom_main_script box.
- Ok, that's all you need to do in the Level Editor. Then go to your mission folder and open the <mymission>_specials.dhs file (in the folder \Shadowgrounds\Mods\<mymod>\Data\Missions\<mymission>\sp). There's probably some scripts already, so let's make a new script at the end of the file.

Code: Select all

script wrencher_floor_attack01

  sub spawnFloorWrencher
    setUnitByIdString floor_wrencher_target
    unitPosition
    setPlayer 1
    externInclude alien_wrencher_spawn_location:create_parts

    setUnitSpawnCoordinatesToPosition
    setUnitAngle 90
    setUnitScript spawned_guard_wrencher_alien
    spawnUnit
    disableUnitAI
    setPlayer 0
    forceUnitAnimation special3
    waitAccurate 1500
    endForcedUnitAnimation
    enableUnitAI

    externInclude common_alien_spawn_location:go_for_player_move
    restoreUnit
  endSub


  sub main
    wait_until_player_closer_than_scriptrange()
 
    setUnitByIdString "floor_hatch"
    externInclude ventilators:break
    externInclude wrencher_floor_attack01:spawnFloorWrencher
    wait 2
    externInclude wrencher_floor_attack01:spawnFloorWrencher 
    wait 2
    externInclude wrencher_floor_attack01:spawnFloorWrencher 
     
  endSub

endScript


Ok that's all, you just have to try. 3 wrenchers will be spawn from the hatch, when you go through the trigger zone.

The code is a copy of the original code from Shadowgrounds, and even the explanation are copied from the tutorials of Joel...

Enjoy...

User avatar
fb_joel
Site Admin
Posts: 2482
Joined: Fri Feb 18, 2005 2:14 pm
Location: Finland

Postby fb_joel » Thu Apr 26, 2007 5:19 pm

Wow, glad to hear it worked! :)

And indeed the picture seems to indicate the normal light overflow. The block system isn't really very good yet... That's something you have to work with currently.

Making Brutes break doors... I haven't done this myself ever yet, but looking at the Mission 5 scripts, it looks surprisingly easy.

I took a screenshot so you can see how it should be in the Editor:
http://www.shadowgroundsgame.com/help_m ... _doors.jpg

In the script it's really simple:

setUnitByIdString "m5_brute3"
enableUnitAI
restoreUnit

I think the Brute AI automatically looks for doors. We used "C, Ind sma breakable door closed, Lock closed" in Mission 5. It doesn't have an id.

Wrencher path in the example mod works like this:

Choose C, Alien, Wrencher, and then from the big dropdown menu just before the Spec, Main etc, choose "Alien Wrencher, guard 000 deg". Then place it in the map. Then choose "Common, Guard, Paths 1" from the Main dropdown menu box. And then just click the Patrol route in the bottom, and click Insert, and start inserting the guard paths. When the alien reaches the last checkpoint, it will go to the first one again.

To make a Wrencher to be triggered by a script... Place a Wrencher in the map (C, Alien, Wrencher Triggered - check that it has all the properties of a normal working Wrencher), give it an id (such as "wren1") and then in the script write (after wait_until_player_closer_than_scriptrange etc whatever else you want):

setUnitByIdString "wren1"
enableUnitAI
restoreUnit
hintMessage "wren1 AI enabled"

That's it. The Wrencher should now start acting normally with its AI.
// Joel, Frozenbyte team

User avatar
MoRt
Posts: 9
Joined: Fri Apr 20, 2007 11:47 pm

Postby MoRt » Thu Apr 26, 2007 10:15 pm

Oh I'm so sorry, Joel.

For the patrol path of the wrencher... I though that "patrol route" was a remember or an hint, but because i work on my laptop, with a low screen resolution, I didn't see the button "Insert"... Otherwise, I might not ask you about patrol, and guard path...

Thank you, for the brute mauler, and the guard wrencher, anyway. I try the mauler as soon as possible.

As I saw the option of patroling of the wrencher, I wanted to know how work the Ambush, Flanking, Repel and Retreat Path. The zone, you place in the map, is the start or the end of the path? Who is affected by those path? The human, us, or the enemy? How to activate a path, and make units use this path?
If you have a mission with an example of one of these path, it may be really helpful...

Thank You ^^

User avatar
fb_joel
Site Admin
Posts: 2482
Joined: Fri Feb 18, 2005 2:14 pm
Location: Finland

Postby fb_joel » Mon Apr 30, 2007 3:46 pm

Ah yes, the resolution is always a bit problematic...

The ambush, flanking, repel and retreat paths work in mysterious ways. ;) I'm not sure if they all work perfectly. At least repel and flanking were used in Shadowgrounds (in Mission1 and Mission4/ISERCom).

The paths affect the aliens (only Scavengers/Wrenchers). Here's how the repel and flanking work (roughly):

- Both repel and flanking require that the player is in the 90 degree zone defined by the triangle lines, and that the player is looking at the enemy unit, who must also be in the 90 degree triangle zone.

- Repel: When an enemy unit gets seen by the player and the unit is in the repel zone, the unit will follow the repel route to the end point. So basically repel is useful if you want to keep enemies (Scavengers) acting like they get scared and run away...

- Flanking: When an enemy unit is seen by the player and the unit is in the flanking zone, the unit will follow the flanking route. Only works in outside environment if I remember correctly.

I took a quick screenshot of Mission4/ISERCom near the beginning that illustrates flanking well:
http://www.shadowgroundsgame.com/help_m ... gpaths.jpg

So basically flanking is useful to give enemies an alternative attack route, like in the screenshot case. If the player is looking at the "normal" fence door, the aliens will go to the back and attack from the broken fence part. If the player is looking at the broken fence, then the aliens will go to the normal fence door.
// Joel, Frozenbyte team


Return to “Mods / Level Editor”

Who is online

Users browsing this forum: No registered users and 4 guests